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