[R] contrasts among simple effects

David Winsemius dwinsemius at comcast.net
Tue Oct 13 21:26:11 CEST 2015


On Oct 13, 2015, at 11:16 AM, James Henson wrote:

> Greetings R Community
> 
> My goal is to make orthogonal contrasts among simple effects in analysis of
> repeated measures data.  The SAS publication, on page 1224, shows how to
> make this type of contrasts in SAS.  But, my search of books about repeated
> measures analysis using R, and on-line has not yielded a methodology.
> Hopefully, someone can direct me to a book or publication that will show me
> a methodology.
> 
> Statistical Analysis of Repeated Measures Data Using SAS Procedures
> 
> http://cslras.pbworks.com/f/littell_j_anim_sci_76_4_analysis_of_repeated_measures_using_sas.pdf
> 
> 
> 
> Attached is a csv data file (file name = heartRate.csv).


The .csv file type is not accepted by the mail server, ever. You would probably get it to be passed through to the list audience if you changed its name to:  heartRate.txt


>  My code for the
> repeated measures analysis is below.
> 
> 
> library("nlme")
> 
> # with AR1 variance/covariance structure, with ordered statement
> 
> heartRate$time <- factor(heartRate$time)
> 
> model2a <- lme(HR ~ drug*ordered(time), random =~1|person, correlation
> =corAR1(, form=~1|person), data = heartRate)
> 

I would have expected `time` to be in that formula. I do think that the correct mailing list would have been r-sig-mixed-models at r-project.org


> summary(model2a)
> 
> anova(model2a)
> 
> 
> Making a new variable ‘simple’ that merges the variables drug and time will
> enable me to make orthogonal contrasts among the simple effects.  But, when
> using the variable ‘simple’ as the independent variable, the data will no
> longer be fitted to the AR1 variance/co-variance structure.
> 
> Thanks.
> 
> Best regards,
> 
> James F.Henson
> ______________________________________________

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list