Thomas Wilde
2006-Feb-11 16:21 UTC
[R] R-newbie-question, fixed effects panel model, large number of observations
Hi, I'm trying to fit a fixed effect (LSDV) panelmodel with R. I have a dataset with y as dependent, x1&x2 as indeps, t as time index and i as an id-variable for each individual. There are three observations for each individual (t=1, t=2, t=3). I want to try a simple regression, but with individual intercepts: ------------------------------------------------- # reading in some data ... mydata <- read.csv(...) attach(mydata) # fit modell mymodel <- lm(y ~ -1 + factor(i) + x1 + x2) summary(mymodel) ------------------------------------------------- Works fine when the size of my dataset doesn't exceed about n=5000 observations, but I have some more. Can I do a partitioned regression with R, are there any other options already implemented in R ? Thanks, Thomas
ronggui
2006-Feb-11 17:03 UTC
[R] R-newbie-question, fixed effects panel model, large number of observations
This is one function I wrote. http://sociology.yculblog.com/post.794856.html 2006/2/12, Thomas Wilde <thomas.wilde at gmx.de>:> Hi, > > I'm trying to fit a fixed effect (LSDV) panelmodel with R. I have a dataset > with y as dependent, x1&x2 as indeps, t as time index and i as an > id-variable for each individual. There are three observations for each > individual (t=1, t=2, t=3). > > I want to try a simple regression, but with individual intercepts: > > ------------------------------------------------- > # reading in some data ... > > mydata <- read.csv(...) > attach(mydata) > > # fit modell > > mymodel <- lm(y ~ -1 + factor(i) + x1 + x2) > summary(mymodel) > ------------------------------------------------- > > Works fine when the size of my dataset doesn't exceed about n=5000 > observations, but I have some more. Can I do a partitioned regression with > R, are there any other options already implemented in R ? > > Thanks, > Thomas > > ______________________________________________ > 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 >-- 伝伷伻佡伖侒 Deparment of Sociology Fudan University