Skip to content

Repeated measures in R

1 message · GenTOstats

#
Hey all

I am relatively new to analysis in R 
(and am a geneticist so apologies for rubbish questions ),

I have a question regarding repeated measures analysis

this was what i have done so far 
1)ph<-make.rm(constant=c("sid","pheno1","snp","sex","age"),repeated=c("measure1","measure2"),data=file)

2) i want to analyze 
 aov( repdat ~ pheno1 + snp + pheno1:snp + repdat:snp + repdat:pheno1 +
repdat:pheno1:snp + age + sex )

when i use SPSS (GLM repeated measures) it automatically generates the above
model for me)

But i read that I need to add in the sample ID term together with the Error
term to get the correct sum of squares 

3) Does this mean i need 

repdat ~ pheno1 + snp + pheno1:snp + repdat:snp + repdat:pheno1 +
repdat:pheno1:snp + age + sex 
             + sid + Error(sid/repdat + pheno1 + snp)

to get the correct anova summary?

Thanks

GS