Regression for individuals grouped using fixed effect

Regression for individuals grouped using fixed effect

Manage alerts

Loading saved threads...

zahrina adani · External communityPost link
External question — Cross Validated Stack Exchange Author: zahrina adani Original post: https://stats.stackexchange.com/questions/404368 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. I have some questions about how to define my regression. So, I want to use fixed effect model in order to estimate the effect of trade openness on gini coefficient. I include 58 countries including developed and developing countries. $$Y_{it} = Z_i + B_{it} Trade + U_{it}$$ However, I'm still confused whether to set the "i" as "country" or the category whether its "developed or developing" because I want to see the results for both developed and developing countries. If I set the "i" as the "country", does it mean that I have 58 intercepts in total? I am using R.
Quote
Report
Peter Flom · External communityPost link
External answer — Cross Validated Stack Exchange Author: Peter Flom Original post: https://stats.stackexchange.com/a/404385 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. Per your comment, you have multiple years for each country. You need to account for that. One way is with a multilevel model. Two such that might be good for you are a random intercept model and a random slopes and intercepts model. These can be modeled as $$y = X\beta + Z\gamma + \epsilon,$$ where $y $ is a $n\times 1$ vector of the dependent variable, $X$ is an $n\times p$ matrix of independent variables, $\beta$ and $\gamma$ are parameters to be estimated ( $\beta$ is for "fixed" effects and $\gamma$ for "random" effects) and $\epsilon$ is error. You will need more than one independent variable - one for "trade" and one for "type of country". However, I would caution against categorizing countries into "developing" and "developed". It would be better to use some continuous measure of how developed a country is. Categorizing continuous IVs is a bad idea. In his book Regression Modeling Strategies Frank Harrell gives a list of reasons and concludes with "nothing could be more disastrous" (it's an excellent book). I recently wrote an article demonstrating, graphically, what happens when we categorize continuous variables. There are at least two R packages for this sort of model: lme4 and nlme .
Quote
Report
Matt P · External communityPost link
External answer — Cross Validated Stack Exchange Author: Matt P Original post: https://stats.stackexchange.com/a/404423 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. However, I'm still confused whether to set the "i" as "country" or the category whether its "developed or developing" because I want to see the results for both developed and developing countries. Either model could be valid. If you think all developed and undeveloped countries should have the same base rate of inequality other than what is explained by your observable controls, you could use developed vs undeveloped. But I would probably go with country fixed effects because there are likely to be important unobservable country-specific features and with so many observations for each country you shouldn't have trouble estimating them well. If I set the "i" as the "country", does it mean that I have 58 intercepts in total? It means you have 57 intercepts total. If you had 58 you would run into the "dummy variable trap."
Quote
Report

Post Reply

Quoted from Forex.com.bd-Editorial External question — Cross Validated Stack Exchange Author: zahrina adani Source score (net votes, not local likes): 2 Original post: https://stats.stackexchange.com/questions/404368 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. I have some questions about how to define my regression. So, I want to use fixed effect model in order to estimate the effect of trade openness on gini coefficient. I include 58 countries including developed and developing countries. $$Y_{it} = Z_i + B_{it} Trade + U_{it}$$ However, I'm still confused whether to set the "i" as "country" or the category whether its "developed or developing" because I want to see the results for both developed and developing countries. If I set the "i" as the "country", does it mean that I have 58 intercepts in total? I am using R.

Cancel quote

Checking account access…