r - Adding abline to augPred plot -
apologies basic question, new r.
i looking read off augpred plot in order average out values provide prediction between time period.
> head(tthm.groupeddata) grouped data: tthm ~ yearmon | wsz_code wsz_code treatment_code year month tthm cl2_free bro3 colour ph turb yearmon 1 2 3 1996 1 30.7 0.35 0.00030 0.75 7.4 0.055 jan 1996 2 6 1 1996 2 24.8 0.25 0.00055 0.75 6.9 0.200 feb 1996 3 7 4 1996 2 60.4 0.05 0.00055 0.75 7.1 0.055 feb 1996 4 7 4 1996 2 58.1 0.15 na 0.75 7.5 0.055 feb 1996 5 7 4 1996 3 62.2 0.20 na 2.00 7.6 0.055 mar 1996 6 5 2 1996 3 40.3 0.15 0.00140 2.00 7.7 0.055 mar 1996
this model:
modellme<- lme(tthm ~ yearmon, random = ~ 1|wsz_code, data=tthm.groupeddata)
and current plot:
plot(augpred(modellme, order.groups=t),xlab="date", ylab="tthm concentration", main="tthm concentration time water supply zones")
i way read off graph either placing lines between specific time period in specific wsz_code (my group) , averaging values between period...
of course other way/help or guidance appreciated!
thanks in advance
i don't think can tell whether "entirely incorrect", since have not described question , have not included data. (the plotting question close being entirely incorrect, though.) can tell answer not use abline
, since augpred objects plotted plot.augpred
returns (and plots) lattice object. abline
base graphic function , not share coordinate system lattice device. lattice objects lists can modified. plot had different panels @ different levels of wsz_code, location of desired lines entirely unclear since trail off ellipsis. refer "times" there no "times" variable.
there lattice functions such trellis.focus
, update.trellis
allow 1 apply modifications lattice objects. first assign plot object named variable, make mods , plot() again.
help(package='lattice') ?lattice
(if rush job, might better off making calculations hand , using imagemagick edit pdf or png output.)
Comments
Post a Comment