dear R wizards:

not important.  more a curiosity or esthetics question.

is there a way to extend the standard lm command, so that it takes a new
argument that handles fixed effects?   right now, I have (provided to me
from an expert---I would have never figured this one out):

   diffid <- function(h,id) {
       id <- as.factor(id)[, drop=TRUE]
       apply(as.matrix(h), 2, function(x) x - tapply(x,id,mean)[id]
   }

which is used as

     r= lm( diffid(y, firmid) ~ diffid(x, firmid ) )

it works, but it would be much nicer if I could just write

    r= lm( y ~ x + z, fixed.effects=firmid )

does this already exists as a package?  or has someone figured out how to
program this?

as I wrote---this is a curiosity question, not a substance question.

regards,

/iaw
----
Ivo Welch (ivo.welch@brown.edu, ivo.welch@gmail.com)

	[[alternative HTML version deleted]]

