How to do a fixed effects panel regression?
6 views (last 30 days)
Show older comments
I have searched through textbooks and forums but not seeming to find what I need. I have 20 countries and for each country I have 10 years of profits which are my response variables. I have 4 dependent variables (each with 10years of data). i.e. PROFITS_ jt = a + beta1*X1_ jt +...+ beta4*X4_ jt + error, where j is the country and t is the year. How should I perform a regression? Any help would be appreciated!
0 Comments
Answers (1)
Image Analyst
on 21 Sep 2017
Spell out your model in full, because it looks like you have the same X_jt in each term and so your model ends up being
PROFITS_jt = a + X_jt * (beta1 + beta2 + beta3 + beta4);
which is the same as PROFITS_jt = a + X_jt * b which is trivially solved by polyfit
coefficients = polyfit(X_jt, PROFITS_jt, 1);
so
a = coefficients(2)
b = coefficients(1)
but I'm not sure what you mean. Why have 4 betas when they all multiply the same X vector?
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!