0

I have a survey made of 13k observations: the dataset in an unbalanced panel based on a survey conducted every two years. The df is based on individual observations from 2010 to 2014.

I wanted to run a two ways fixed effect regression and I used these commands:

df <- plm.data(d.d, c("id", "year")
eq <- plm(Y ~ X, data=df, model="within", effect="twoways") 

where id is the individual variable, year is time variable, Y is a binary dependent variable and X is the matrix of regressors (for the sake of simplicity I omitted the original regressors; in the original model there are demographic and economic variables). Since the command takes a lot of time to run a twoway regression, I tried another way.

I tried to run a twoway regression using dummies: I could introduce n-1 time dummies (year 2012 and year 2014; year 2010 is omitted), but I couldn't do the same for individual observations since the df is composed by thousands of observations.

Since the within estimation drops time invariant variables I thought that using a wihtin estimation with time dummies could be a solution. Is it right or it's just a big mistake?

The command is this one:

df$year <- as.factor(df$year)
levels(df$year)
"2010" "2012" "2014"

eq <- plm(Y ~ X + year, model="wihtin", data=df)

Thanks in advance

Laura R.
  • 99
  • 1
  • 10
  • 1
    Interesting question. You should probably post it on http://stats.stackexchange.com, as it is a conceptual econometrics matter and not directly related to programming – KenHBS Nov 15 '16 at 15:51
  • Thank you @KenS. for your answer; I tried to get the two ways regression in this way because I found an old exercise of university lesson in which the same approach was applied using individual dummies instead of time dummies (the dummie was referred to national areas and were introduced in a within estimation like the one I wrote); for this reason I thought it could be a solution but I was not sure. – Laura R. Nov 15 '16 at 16:03
  • 2
    Check out [this](http://stats.stackexchange.com/questions/66973/difference-between-fixed-effects-models-in-r-plm-and-stata-xtreg). Just very quickly - your first ("twoways") and second (with year dummies) regression models are equivalent--adding year fixed effects is the same as adding year dummies. Adding individual fixed effects is the same as adding a dummy for each entity. – paqmo Nov 15 '16 at 16:13
  • Agree this is the same. But be aware that the plm package will compute your degrees of freedom differently if you use dummies and thus some of the model summary statistics will be different -- although your coefficient estimates and standard errors will be the same. – gfgm Nov 15 '16 at 23:41

0 Answers0