[R] Mean and individual growth curve trajectories

jlwoodard john.woodard at wayne.edu
Mon Nov 1 03:01:17 CET 2010


I'm trying to understand how to plot individual growth curve trajectories,
with the overall mean trajectory superimposed (preferably in a slightly
thicker line, maybe in black) over the individual trajectories.  Using the
sleepstudy data in lme4, here is the code I have so far:

library(lme4)
library(lattice) 
xyplot(Reaction ~ Days, data = sleepstudy, group = Subject, type = 'l')

This plot produces the individual growth curves nicely, but I'd like to be
able to plot the mean for each day (averaged over subjects) on top of this
graph.

Many thanks in advance for any help/suggestions.

John

-- 
View this message in context: http://r.789695.n4.nabble.com/Mean-and-individual-growth-curve-trajectories-tp3021672p3021672.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list