[R] contrasts among simple effects - 2
Greetings R Community Apologize for previously sending a csv file. 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 txt data file (file name = heart_rate.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) 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/covariance structure. Thanks. Best regards, James F.Henson drugperson timeHR a 1 1 72 a 4 1 78 a 7 1 71 a 10 1 72 a 13 1 66 a 16 1 74 a 19 1 62 a 22 1 69 b 2 1 85 b 5 1 82 b 8 1 71 b 11 1 83 b 14 1 86 b 17 1 85 b 20 1 79 b 23 1 83 c 3 1 69 c 6 1 66 c 9 1 84 c 12 1 80 c 15 1 72 c 18 1 65 c 21 1 75 c 24 1 71 a 1 2 86 a 4 2 83 a 7 2 82 a 10 2 83 a 13 2 79 a 16 2 83 a 19 2 73 a 22 2 75 b 2 2 86 b 5 2 86 b 8 2 78 b 11 2 88 b 14 2 85 b 17 2 82 b 20 2 83 b 23 2 84 c 3 2 73 c 6 2 62 c 9 2 90 c 12 2 81 c 15 2 72 c 18 2 62 c 21 2 69 c 24 2 70 a 1 3 81 a 4 3 88 a 7 3 81 a 10 3 83 a 13 3 77 a 16 3 84 a 19 3 78 a 22 3 76 b 2 3 83 b 5 3 80 b 8 3 70 b 11 3 79 b 14 3 76 b 17 3 83 b 20 3 80 b 23 3 78 c 3 3 72 c 6 3 67 c 9 3 88 c 12 3 77 c 15 3 69 c 18 3 65 c 21 3 69 c 24 3 65 a 1 4 77 a 4 4 81 a 7 4 75 a 10 4 69 a 13 4 66 a 16 4 77 a 19 4 70 a 22 4 70 b 2 4 80 b 5 4 84 b 8 4 75 b 11 4 81 b 14 4 76 b 17 4 80 b 20 4 81 b 23 4 81 c 3 4 74 c 6 4 73 c 9 4 87 c 12 4 72 c 15 4 70 c 18 4 61 c 21 4 68 c 24 4 63 __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
Re: [R] contrasts among simple effects
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-mod...@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 __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
[R] contrasts among simple effects
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). 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) 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 __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.