[R] nlme fixed effects specification

From: ivo welch <ivowel_at_gmail.com>
Date: Thu, 03 May 2007 14:03:42 -0400


dear R experts:

sorry, I have to ask this again. I know that the answer is in section 7.2 of "S Programming," but I don't have the book (and I plan to buy the next edition---which I hope will be titled S/R programming ;-) ).

I believe the following yields a standard fixed-effects estimation:

fixed.effects = as.factor( as.integer( runif(100)*10 ) ) y=rnorm(100); x=rnorm(100);
print(summary(lm( Y ~ X + fe)))

I would like to know how to get the same coefficient on X using nlme. (I cannot use this ordinary lm method in my real application, simply because I have 10,000 fixed effects.) I tried a variety of arguments to the "fixed" nlme parameter (e.g., fixed=list(fmid)), but did not get the syntax right. could someone please tell me the magic spell?

may I also suggest that such an example be added to the nlme examples documentation, too, please?

help appreciated.

regards,

/ivo



R-help_at_stat.math.ethz.ch 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. Received on Thu 03 May 2007 - 18:10:30 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 04 May 2007 - 16:31:51 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.