Re: [R] fixed and random effects question

2004-04-11 Thread Prof Brian Ripley
Consider the case of a response vs time for multiple measurements on subjects. If one has both fixed and random effect for slope and intercept, it means there is a separate linear relationship with time for each subject (the random effect) and that the population average may have a non-zero

[R] pasting results into Word/Excel

2004-04-11 Thread Graham M Smith
Is there some clever way of pasting results from R into Excel or Word, as tab limited format so they are easy to turn into a formatted table. Or is there some other way of doing this to avoid the time spent reformatting the output for presentation. If different, I am also interested in an

Re: [R] pasting results into Word/Excel

2004-04-11 Thread Peter Dalgaard
[EMAIL PROTECTED] (Graham M Smith) writes: Is there some clever way of pasting results from R into Excel or Word, as tab limited format so they are easy to turn into a formatted table. Have a look at write.table(). -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ ---

Re: [R] pasting results into Word/Excel

2004-04-11 Thread Uwe Ligges
Graham M Smith wrote: Is there some clever way of pasting results from R into Excel or Word, as tab limited format so they are easy to turn into a formatted table. Or is there some other way of doing this to avoid the time spent reformatting the output for presentation. To copy/paste your

Re: [R] pasting results into Word/Excel

2004-04-11 Thread Graham M Smith
Anders, This seems a good start, and I will try it get it to work, on of the issues is that the results output is more complex than simply split by comma eg a typical Summary output of my current data set (below) However, I am a lot further forward than I was a few hours ago. Thanks

Re: [R] pasting results into Word/Excel

2004-04-11 Thread Graham M Smith
Uwe, To copy/paste your data.frame X to Excel, use the following lines to write it to the clipboard from R: Thanks, this is certainly a step in the right direction, it doesn't work as it stands but it has given me a start If different, I am also interested in an answer to the same

Re: [R] pasting results into Word/Excel

2004-04-11 Thread Gabor Grothendieck
Graham M Smith graham.smith at myotis.co.uk writes: : Is there some clever way of pasting results from R into Excel or Word, as : tab limited format so they are easy to turn into a formatted table. Try this: data(iris) # get a test data frame require(R2HTML) HTML( iris,

[R] Intercept in lasso models

2004-04-11 Thread Martin Keller-Ressel
Hello, Im using the function l1ce (L1-constrained estimation) from the lasso2 package. when I try the example from the help pages data(Prostate) l1c.P - l1ce(lpsa ~ ., Prostate, bound=.5) coef(l1c.P) (Intercept) lcavol lweight age lbph svi 0.7284810757

[R] question on plot dates

2004-04-11 Thread Linda portman
I am trying to plot time variable (the time is recoded for three days at 5 minutes interval in the format of 2001-05-14 13:45:00) VS. blood pressure. My code is the following: plot(time, bloodpressure,xlab=Time,ylab=bPress,main=Time VS Blood Pressure, type=l, xaxt=n) r -

[R] Killed

2004-04-11 Thread XIAO LIU
I tried bootstrap on a sample of 13,000 observations: It works fine when R = 200: boot(data, cor.i, R = 200) However, when R = 400, I got: boot(data, cor.i, R = 400) Killed Any suggestions/ideas? Thank you very much Xiao __ [EMAIL PROTECTED]

Re: [R] pasting results into Word/Excel

2004-04-11 Thread Graham M Smith
Gabor, : Is there some clever way of pasting results from R into Excel or Try this: data(iris) # get a test data frame require(R2HTML) HTML( iris, file(clipboard,w), append=F ) This worked exactly as I was hoping. Many thanks, Graham

Re: [R] question on plot dates

2004-04-11 Thread Prof Brian Ripley
On Sun, 11 Apr 2004, Linda portman wrote: I am trying to plot time variable (the time is recoded for three days at 5 minutes interval in the format of 2001-05-14 13:45:00) VS. blood pressure. My code is the following: plot(time, bloodpressure,xlab=Time,ylab=bPress,main=Time VS Blood

Re: [R] Killed

2004-04-11 Thread Prof Brian Ripley
On Sun, 11 Apr 2004, XIAO LIU wrote: I tried bootstrap on a sample of 13,000 observations: It works fine when R = 200: boot(data, cor.i, R = 200) However, when R = 400, I got: boot(data, cor.i, R = 400) Killed Any suggestions/ideas? Read the posting guide and tell us at least what

[R] converting lme commands from S-PLUS to R

2004-04-11 Thread Roger D. Peng
I'm trying to do some smoothing with lme and am having some difficulty bringing commands over from S-PLUS to R. I have the following setup (modified from Ngo and Wand, 2004): set.seed(1) x - runif(200) y - sin(3*pi*x) + rnorm(200)*.4 ## library(splines) z - ns(x, 4) The following runs without

[R] plot question

2004-04-11 Thread Linda portman
I have a variable named Medicine which has seven values in date format, on the following plot, how can I use a red line to indicate the time when the medicine was taken on x axis? The following is my original plot of blood pressure vs. time. plot(time,

Re: [R] converting lme commands from S-PLUS to R

2004-04-11 Thread Peter Dalgaard
Roger D. Peng [EMAIL PROTECTED] writes: f - lme(y ~ 1, random = pdIdent(~ -1 + z)) But in R I get library(nlme) f - lme(y ~ 1, random = pdIdent(~ -1 + z)) Error in getGroups.data.frame(dataMix, groups) : Invalid formula for groups Does the S-PLUS lme have some default

[R] Only referenc copy when calling C routine?

2004-04-11 Thread Shin, Daehyok
What happens when I pass an array to a dynamically linked C routine? Is only its reference copied when an array is passed and returned? Or, is its whole content copied? In R extension manual, I found the following description. But, I can't know exactly which is true. There can be up to 65

RE: [R] Only referenc copy when calling C routine?

2004-04-11 Thread Liaw, Andy
I thought that description is rather clear. If `x' is a vector of doubles, then result - .C(myCfunc, x = x) makes a copy of `x' to be passed to `myfunc'. The copy in R is not touched. When `myfunc' returns, another copy is made and placed into result[[x]]. There's the `DUP' argument in

RE: [R] Only referenc copy when calling C routine?

2004-04-11 Thread Shin, Daehyok
Thanks, Andy. Let me ask a little more about the DUP argument. In the manual, I can see that only reference copy happens when passing an array, if DUP=FALSE. Then, what happens when returning it in a list, if DUP=FALSE? Another reference copy, or deep copy? I am trying to implement a dynamic

RE: [R] Only referenc copy when calling C routine?

2004-04-11 Thread Liaw, Andy
My understanding is that if DUP=FALSE, no copying is done in either direction. If you want to avoid copying, the .Call interface is probably more suitable, as you pass the actual R objects to the C function. I'm not familiar with that, though. Andy From: Shin, Daehyok [mailto:[EMAIL

Re: [R] Only referenc copy when calling C routine?

2004-04-11 Thread Duncan Murdoch
On Sun, 11 Apr 2004 21:25:13 -0400, you wrote: My understanding is that if DUP=FALSE, no copying is done in either direction. If you want to avoid copying, the .Call interface is probably more suitable, as you pass the actual R objects to the C function. I'm not familiar with that, though. If

RE: [R] Only referenc copy when calling C routine?

2004-04-11 Thread Liaw, Andy
For me it's just a matter of getting my hands dirty, I guess. For whatever reason I seem to have a mental block about the PROTECT/UNPROTECT business... Best, Andy From: Duncan Murdoch [mailto:[EMAIL PROTECTED] On Sun, 11 Apr 2004 21:25:13 -0400, you wrote: My understanding is that if

RE: [R] Only referenc copy when calling C routine?

2004-04-11 Thread Shin, Daehyok
Thanks, Murdoch. The .Call is what I want. In R extension manual, Neither .Call nor.External copy their arguments. You should treat arguments you receive through these interfaces as read-only. Daehyok Shin -Original Message- From: Duncan Murdoch [mailto:[EMAIL PROTECTED] Sent:

Re: [R] Only referenc copy when calling C routine?

2004-04-11 Thread Duncan Murdoch
On Sun, 11 Apr 2004 21:43:58 -0400, you wrote: For me it's just a matter of getting my hands dirty, I guess. For whatever reason I seem to have a mental block about the PROTECT/UNPROTECT business... Just protect every SEXP until you don't care if it goes away. It might be possible to skip some

[R] Very large matrices for very large genome

2004-04-11 Thread Antonio Garcia
Hello, I am using R to look at whole-genome gene expression data. This means about 27,000 genes, each with a vector of numbers reflecting expression at different tissues and times. I need to do an all against all co-expression calculation (basically, just calculate Pearson's r for every

Re: [R] Very large matrices for very large genome

2004-04-11 Thread Duncan Murdoch
On Sun, 11 Apr 2004 19:15:08 -0700 (PDT), you wrote: Hello, I am using R to look at whole-genome gene expression data. This means about 27,000 genes, each with a vector of numbers reflecting expression at different tissues and times. How long is that vector? Presumably shorter than 27000. I

[R] missing values and survival analysis

2004-04-11 Thread john . ferguson
Hi everyone, I'm analysing a survival analysis data set at the moment with missing values in the covariate and survival vectors (I have about 60 variables). I know there are some functions on the CRAN network to deal with missing values in general multivariate data. Does anybody know of

[R] ARMA models with ARCH errors?

2004-04-11 Thread Ajay Shah
In R, I see support for ARCH models and for ARMA models (in the tseries package). How would we estimate the workhorse model where stock returns are ARMA with ARCH errors? I am aware of the paper by Andy Weiss. I have used this model quite a bit using stata and consider it a staple. I couldn't

Re: [R] Clever R syntax for extracting a subset of observations

2004-04-11 Thread Ko-Kang Kevin Wang
Hi, - Original Message - From: Ajay Shah [EMAIL PROTECTED] But this doesn't work since if D is a data frame, you can't say D[d]. Let me show you: x = runif(100) y = runif(100) D = data.frame(x, y) d = c(7,3,2) E = D[d] Error in [.data.frame(D, d) : undefined columns

Re: [R] Clever R syntax for extracting a subset of observations

2004-04-11 Thread Gabor Grothendieck
sdratio - function(D, d) with( D[d,], sd(x)/sd(y) ) Ajay Shah ajayshah at mayin.org writes: : : I know that if: :x = seq(1,10) :d = c(7,3,2) : and if I say :y = x[d] : then I get the vector y as (7,3,2). Very clever! This idea is used : intensively with the boot library. : : Now

Re: [R] plot question

2004-04-11 Thread Gabor Grothendieck
plot(1:10) abline(v=c(3,5,7), col=red) Linda portman lindaportman at yahoo.com writes: : : I have a variable named Medicine which has seven values in date format, on the following plot, how can I use : a red line to indicate the time when the medicine was taken on x axis? : : The following