[R] Can plot(augPred()) be used with objects that are not groupedData?
Michael Kubovy
kubovy at virginia.edu
Fri Nov 10 17:22:13 CET 2006
Dear Friends,
Is there a workaround to this problem or must the object plotted by
plot(augPred(object, ...)) be a grouped object?
score <- c(108, 103, 96, 84, 118, 110, 129, 90, 84, 96,
105, 113, 96, 117, 107, 85, 125, 107, 128, 84, 104,
100, 114, 117, 110, 127, 106, 92, 125, 96, 123, 101,
100, 103, 105, 132, 122, 133, 107, 99, 116, 91, 128,
113, 88, 105, 112, 130)
mcc <- data.frame(
subject = factor(rep(1:12, 4)),
age =rep(seq(30, 48, by = 6), each = 12),
score = score
)
mccG <- groupedData(score ~ age | subject, data = mcc)
class(mcc)
class(mccG)
mcc.lme <- lme(score ~ age, random = ~ 1 | subject, mcc)
mccG.lme <- lme(mccG)
summary(augPred(mcc.lme, primary = ~ mcc$age)) # works
summary(augPred(mccG.lme)) # works
plot(augPred(mcc.lme, primary = ~ mcc$age)) # doesn't show fitted line
plot(augPred(mccG.lme)) # does show fitted line
_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS: P.O.Box 400400 Charlottesville, VA 22904-4400
Parcels: Room 102 Gilmer Hall
McCormick Road Charlottesville, VA 22903
Office: B011 +1-434-982-4729
Lab: B019 +1-434-982-4751
Fax: +1-434-982-4766
WWW: http://www.people.virginia.edu/~mk9y/
More information about the R-help
mailing list