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) 

imgur


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -