Dear Statalist community,
I need help with two things:
One, I want to use the margins and marginsplot command to illustrate findings from a quadratic variable in fixed effects panel models.
Two, I want to illustrate the findings from the margins and marginsplot with the quadratic variable in level form (the original IV is logged but want to make the findings more intuitive for the audience).
Details:
Cross-sectional longitudinal country-level data from the World Bank's World Development Indicators and the United Nations Center for Trade and Development
Dependent variable: Economic growth (annual percentage change in GDP per capita), level form
Independent variable of interests:
1) Foreign direct investment stock as a percentage of GDP, logged
2) Foreign direct investment stock as a % of GDP 2
Other relevant IVs included and will mention if necessary
MODEL:xtreg DV IV, fe vce(cluster country)
I am finding that a positive significant association between FDI stocks as a percentage of GDP (ln) and economic growth. The quadratic is negative in direction and statistically significant.
What I need help with:
1) I want to use margins and marginsplot to graph the aforementioned finding. Can someone help me with the syntax to graph the quadratic?
What I normally do is:
margins, at ( IV = ( () ))
marginsplot
2) I want to graph the quadratic using margins and marginsplot. However, FDI stocks as a % of GDP (ln) on the x axis is not quite intuitive. I want to present FDI stocks as a percentage of GDP in level form after conducting the regression analysis with this IV logged. Hopefully this makes sense.
I tried the following syntax to automate the exponentiation but this syntax only changed the DV (in analyses of CO2 emissions (ln) ).
margins, at (IV = (#(#)#)) expression (exp(predict(xb)))
Really appreciate the help!
-Andrew
0 Response to Using MarginsPlot to visualize Quadratics in Panel Data
Post a Comment