Hi Alex,
I'm slightly unclear as to why you would want to restructure your nice
six-column data.frame (why six? One column for the data and four for the
factors should make five, shouldn't it? I guess you have a subject ID in
one column?) into some monstrosity which I assume you would fill with
lots of indicator variables. R does all this for you, just do something like
library(nlme)
lme(response~factor1+factor2+factor3+factor4,random=~1|ID,data=dataset)
assuming that your data.frame is called dataset with column names
response, factor1, ..., factor4 and ID (and that the above is the model
you want). Take a look at the help page for lme() and the Orthodont data
set, which is used as an example in the lme() help page. And next time,
send along a snippet of your data.frame, that would help us help you.
HTH
Stephan
Am 07.09.2010 20:19, schrieb Walther, Alexander:> Dear list,
>
> i am setting up a GLM for a repeated measurement ANOVA using the lm and
> ANOVA function. my design contains four factors with 5, 5, 2 and 2 (>
14) levels, respectively. the data are stored in a data.frame with six
> columns, one for the data themselves and the remainings for the factors
> where strings indicate the factor levels in each row. now i would like
> to restructure this data.frame using cbind which yields a 100 x 14
> array. so far i only included two subjects in the analysis and the 100
> rows emerge because each subject contributes 50 values. for the ANOVA
> however, it seems to me that i should create a multi-dimensional array
> where each dimension accounts for one specific factor and its levels. is
> it possible to do this in R? if so, does the lm or ANOVA function
> necessitates this type of array or is there yet another way to continue?
>
>
> Best
>
> Alex
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>