[R] linear models

FAHEEM MITHA faheem at email.unc.edu
Fri Mar 31 04:31:36 CEST 2000

Dear R users,

I have a couple of linear model related questions. 

1) How do I produce a fixed effect linear model using lme? I saw somewhere
(this may be Splus documentation since I use Splus and R interchangeably)
that using lme(...,random= ~ -1 | groups,...) works, but it gives the same
as lme(...,random= ~ 1 | groups,...), ie. fits a random effect intercept

The reason why I want to do this is test for the significance of the
random effect intercept term. anova( , ) does not work for an lm model and
lme model together.

2) Is there some nice way of handling linear models which are of the form

response_ij = a_i + b_i x_ij + \epsilon_ij 

where a_i and b_i are fixed effects, x_ij is given (continuous) data,
\epsilon_ij ~ N(0, \sigma^2), and the i's range over some group? This is
basically a group of regression models, but I want them handled as one
unit for the purposes of estimation of \sigma^2 etc. I know that lmList()
does fit such a model, but does so as a group of separate models. I can
see that this would be possible to do this using lm() and indicator
variables, but this seems like a clumsy approach. Surely there is a better

                                  Sincerely, Faheem Mitha.

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list