r - Plotting Observed Vs Predicted variables on the same graph in Lattice -
i'm trying plot observed , predicted variables on same plot in lattice
. data repeated dataset , i've tried few things haven't worked. assistance appreciated. code given below.
library(nlme) library(lattice) # add random conc predictions data theoph$predconc <- rnorm(132, 5) # attempt @ plotting both predconc , conc against time on same plot lattice::xyplot(predconc + conc ~ time | subject, groups=subject, data=theoph, type="l", layout = c(4,4))
as can see, doesn't seem doing want do. ideally "conc" , "predconc" in different colours appear on each panel each id can compare 2 easily.
as suggested in comments, fixed dropping groups = subject
.
lattice::xyplot(predconc + conc ~ time | subject, data = theoph, type = "l", auto.key = true)
Comments
Post a Comment