[R] contrasts among simple effects - 2

James Henson jfhenson1 at gmail.com
Tue Oct 13 23:58:00 CEST 2015


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
-------------- next part --------------
drug	person	time	HR
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


More information about the R-help mailing list