panel ols with unbalanced data
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I'm able to run an ols panel regression with balanced data, that is for every cross section j I have the same number of observations t in the time dimension. My problem is that now cross section j=1 has a different number of observation in the time dimension than cross section j=2. How can I write a general code using mvregress in order resolve this problem?
0 Commenti
Risposta accettata
Hang Qian
il 21 Set 2016
Hi Alberto,
For an unbalanced panel data set, one may consider padding NaNs in the response variables for those cross-sections with fewer observations in the time dimension. For example, at j=1 there are 2 observations, at j=2 there is only one observation. By artificially creating a second equation with fake regressors but NaN in the response variable at j=2, an unbalance panel becomes a balanced one. MVREGRESS uses Expectation-Maximization (EM) to maximize the log likelihood function. The EM algorithm is friendly to missing values. I think RVREGRESS will work as usual in the presence of NaNs.
Regards,
Hang Qian
3 Commenti
Hang Qian
il 28 Set 2016
Yes, you are right. MVREGRESS does not have any indicator variable for indexing the unbalanced panel data, so the workaround is to make the data artificially balanced. EM algorithm can use the conditional mean to make an educated guess (i.e., impute) on the missing values.
Più risposte (0)
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!