Displaying 1 result from an estimated 1 matches for "predfinal".
2005 Oct 14
1
lattice with predicted values
...ctor with levels a,b,c
COV is the covariate
mod ~ lm(Y ~ COV + FACT)
#The following draws the right predictions if the relation is the
same for all factor levels, but I can't figure out how to have the
same slopes but different intercepts.
# Function to draw predictions in xyplot
panel.predfinal <- function(mod, x, y) {
xfit <- seq(min(x), max(x), length=21)
yfit <- predict(mod, newdata=data.frame(COV=xfit))
llines(xfit,yfit,lty=1) }
xyplot(Y ~ COV | FACT,
panel=function(x,y,groups,subscripts){
panel.xyplot(x,y)
panel.predfina...