[R] SAS to R: I would like to replicate a statistical analysis performed in SAS in R.

2011-11-30 Thread Marianne Stephan
Hello everybody, A statistician performed an analysis in SAS for me which I would like to replicate in R. I have however problems in figuring out the R code to do that. As I understood it was a "covariance regression model". In the analysis, baseline was used as covariate and autoregressive

[R] Help in determining the formula for a mixed model analysis

2011-11-29 Thread Marianne Stephan
Dear R and statistics experts: I have data of a behavioral experiment with the aim to investigate the effect of a memory task on motor learning. Question: I would appreciate help in figuring out a possible formula to determine whether motor learning across sessions differs between 2 groups.

Re: [R] How can I calculate the median for each factor combination?

2010-12-08 Thread Marianne Stephan
tor combination? To: mariannestep...@hotmail.com CC: r-help@r-project.org Hi Marianne, Please consider the following: with(table, aggregate(rt, list(group, session), FUN = median)) HTH,Jorge On Wed, Dec 8, 2010 at 9:29 AM, Marianne Stephan <> wrote: Hello everybody, I would like to calc

[R] How can I calculate the median for each factor combination?

2010-12-08 Thread Marianne Stephan
Hello everybody, I would like to calculate the median for each factor combination, with only one value per factor combination as an output. Could anybody help me? For example: # make table g<-1:2 group<-rep(g, each=5) session<-c(1,1,2,2,2,1,1,1,2,2) rt<-seq(length=10,300, 800) rt<-round(rt, dig

[R] How can I refer to actual (n) and previous (n-1) elements in a vector?

2010-12-06 Thread Marianne Stephan
Hello, How can I apply a function on a vector that refers to actual (n) and previous elements in the vector (e.g. n-1)? For example: I would like to calculate the sum of (n-1) + n for each element of a vector and get a vector as a result. Besides others I tried this: v<-c(3,6,8,1,1,3,9,