I wish to display a single-panel Lattice figure with grouped data and fitted 
regression lines. I don't seem to be able to get the
individual regression lines to display, e.g.;

d <- data.frame(q = rep(1:6, each=10), cc = rep(seq(10,100, 10),6))             
             # create data frame with group identifier 'q', independent 
variable cc
d$ba = d$q*0.1*d$cc + 5*rnorm(nrow(d))                                          
                                 # create dependent variable 'ba'

mypanel <- function(...){                                                       
                                                       # panel function
                panel.lmline(d$cc, d$ba, groups = d$q)                          
                                        #
                panel.xyplot(...)
                }

xyplot(ba~cc,d,
                groups=q,
                panel = panel.superpose,
                panel.groups=mypanel
                )

Can anyone suggest how to get lines to display by group? (and how to get lmline 
panel to fit line without estimating an intercept?)


Seth W. Bigelow, Ph.D.
Research Ecologist
USDA-FS Pacific Southwest Research Station


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to