[R] Large number of dummy variables

From: Alan Spearot <acspearot_at_gmail.com>
Date: Mon, 21 Jul 2008 14:55:34 -0700


I'm trying to run a regression predicting trade flows between importers and exporters. I wish to include both year-importer dummies and year-exporter dummies. The former includes 1378 levels, and the latter includes 1390 levels. I have roughly 100,000 total observations.

When I'm using lm() to run a simple regression, it give me a "cannot allocate ___" error. I've been able to get around time-demeaning over one large group, but since I have two, it doesn't work in the correct way. Is there a more efficient way to handling a model matrix this large in R?

Thanks for your help.

Alan Spearot

        [[alternative HTML version deleted]]

R-help_at_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. Received on Tue 22 Jul 2008 - 08:36:43 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 Tue 22 Jul 2008 - 09:32:03 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.

list of date sections of archive