[R] regression with more than one observation per x value

Christoph Scherber Christoph.Scherber at uni-jena.de
Tue Aug 16 16:20:07 CEST 2005


Dear R users,

How can I do a regression analysis in R where there is more than one 
observation per x value? I tried the example in Sokal&Rohlf (3rd edn., 
1995), page 476 ff., but I somehow couldn´t find a way to partition the 
sums of squares into "linear regression", "deviations from regression", 
and within-groups SS.

I tried

model1<-lm(y~as.numeric(x)+as.factor(x) #with treatment contrasts


but I am sure there´s a better way around it. I would be very happy if 
anyone could give me some suggestions on this.

Best regards
Christoph.




More information about the R-help mailing list