Well, the best approach is not to model so many fixed effects. But, if you 
must, there are a few options. First, have you considered treating them as 
random effects and using a mixed effects linear model? 

If you must build such a large model matrix for the fixed effects, the best 
thing to do is to use some functions in the Matrix namespace to use sparse 
matrices. For instance,

fm <- Matrix:::lm.fit.sparse(sparse.model.matrix(~data$yourFactor), 
data$yourOutcomeVariable)

where data$yourFactor is the factor variable with the postal IDs and 
data$yourOutcomeVariable is the DV for the regression.


-----Original Message-----
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
Behalf Of Roy Lowrance
Sent: Sunday, March 21, 2010 8:01 PM
To: r-help@r-project.org
Subject: [R] fixed effects regression

Hi All:

I am trying to move a model from Stata to R.

It is a linear regression model with about 90,000 indicator variables.

What is the best approach to follow in R?

- Roy

        [[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.

______________________________________________
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