I am attempting to run an analysis of co-variance on a mixed effect model. My data set is as follows
> str(try)
Classes ‘tbl_df’, ‘tbl’ and 'data.frame': 864 obs. of 7 variables:
$ Site : chr "BISC1" "BISC1" "BISC1" "BISC1" ...
$ SET : Factor w/ 3 levels "SET1","SET2",..: 1 1 1 1 1 1 1 1 1 1 ...
$ ARM : chr "A_0001" "A_0001" "A_0001" "A_0001" ...
$ Pin : num 1 2 3 4 5 6 7 8 9 1 ...
$ SETarmpin : chr "SET1_A_0001_1" "SET1_A_0001_2" "SET1_A_0001_3"
"SET1_A_0001_4" ...
$ Days : num 145 145 145 145 145 145 145 145 145 145 ...
$ AbsPinDiff: num -1 -4 7 -12 -5 0 -5 -1 0 -22 ...
> dput(head(try))
structure(list(Site = c("BISC1", "BISC1", "BISC1", "BISC1", "BISC1",
"BISC1"), SET = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = c("SET1",
"SET2", "SET3"), class = "factor"), ARM = c("A_0001", "A_0001",
"A_0001", "A_0001", "A_0001", "A_0001"), Pin = c(1, 2, 3, 4,
5, 6), SETarmpin = c("SET1_A_0001_1", "SET1_A_0001_2", "SET1_A_0001_3",
"SET1_A_0001_4", "SET1_A_0001_5", "SET1_A_0001_6"), Days = c(145,
145, 145, 145, 145, 145), AbsPinDiff = c(-1, -4, 7, -12, -5,
0)), row.names = c(NA, -6L), class = c("tbl_df", "tbl", "data.frame"
))
My mixed effect model is as below :
trymodel<-lme(AbsPinDiff~Days+SET, random = ~1|SETarmpin,
correlation = corAR1(form=~Days|SETarmpin),
data = try, na.action = na.exclude, method="REML")
I am using the Anova function within the 'car' package. Yet when I run the function on the above model I get the following error message as below :
> Anova(trymodel4)
Error in terms.formula(object, data = data) :
'data' argument is of the wrong type
I am a bit confused because from what I can surmise, the Anova function does not have a 'data' argument.