Hello Statalist users,
I would like to use Stata’s “margins” command to estimate the expected value of my dependent variable at the minimum, mean, and maximum of two continuous predictors, and to compare these effects across two groups of countries: high rent states and non-high rent states. When I estimate these predicted outcomes, I need to do so at the mean of all other control variables.
I have cross-national panel data in Stata 13. This is the main model I’m trying to estimate marginal effects with:
xtreg PTS democ1 gdppcppp gini weapons population highrentstates interactedhighrents if fullsample==1, fe vce (cluster country)
“Democ1” is significant, and so is “interactedhighrents,” although less so. The latter is an interaction term made by interacting the continuous variable “reosurcerents” with “highrentstates.” Highrentstates is a dummy where a value of 1 means a country is a high rent state.
I want to compare marginal effects of the min, mean, and max of “resourcerents” and “democ1” across countries who are high rent states and those who are not. Again, the objective is to learn how significant “resourcerents” is compared to “democ1” in both kinds of countries.
In order to obtain this output and render it graphically, I have searched in numerous places (help margins, UCLA Stats, Professor Williams' 2012 article on the margins command, youtube, etc.) I’ve tried using syntax as well as the menu bar.
So as to tell Stata what my moderator is, I've also used this version of syntax:
xtreg PTS democ1 gdppcppp gini weapons population i.highrentstates c.resourcerents#i.highrentstates if fullsample==1, fe vce (cluster country)
Instead of providing any coefficients from my margin commands, the output consistently reads “not estimable.”
Other examples of postestimation syntax I’ve tried:
margins highrentstates, dydx(democ1) at((min) democ1 (mean) democ1 (max) democ1)
margins highrentstates, dydx(resourcerents) continuous at((min) democ1 (mean) democ1 (max) democ1)
margins highrentstates, at (democ=(0, 1.65, 2.3979))
Is this something I can execute in one command, or does it require a number of separate steps?
This is my first query to the listserv and I do appreciate hearing peoples’ answers.
Sincerely,
Alessandro Morosin
UC Riverside
I would like to use Stata’s “margins” command to estimate the expected value of my dependent variable at the minimum, mean, and maximum of two continuous predictors, and to compare these effects across two groups of countries: high rent states and non-high rent states. When I estimate these predicted outcomes, I need to do so at the mean of all other control variables.
I have cross-national panel data in Stata 13. This is the main model I’m trying to estimate marginal effects with:
xtreg PTS democ1 gdppcppp gini weapons population highrentstates interactedhighrents if fullsample==1, fe vce (cluster country)
“Democ1” is significant, and so is “interactedhighrents,” although less so. The latter is an interaction term made by interacting the continuous variable “reosurcerents” with “highrentstates.” Highrentstates is a dummy where a value of 1 means a country is a high rent state.
I want to compare marginal effects of the min, mean, and max of “resourcerents” and “democ1” across countries who are high rent states and those who are not. Again, the objective is to learn how significant “resourcerents” is compared to “democ1” in both kinds of countries.
In order to obtain this output and render it graphically, I have searched in numerous places (help margins, UCLA Stats, Professor Williams' 2012 article on the margins command, youtube, etc.) I’ve tried using syntax as well as the menu bar.
So as to tell Stata what my moderator is, I've also used this version of syntax:
xtreg PTS democ1 gdppcppp gini weapons population i.highrentstates c.resourcerents#i.highrentstates if fullsample==1, fe vce (cluster country)
Instead of providing any coefficients from my margin commands, the output consistently reads “not estimable.”
Other examples of postestimation syntax I’ve tried:
margins highrentstates, dydx(democ1) at((min) democ1 (mean) democ1 (max) democ1)
margins highrentstates, dydx(resourcerents) continuous at((min) democ1 (mean) democ1 (max) democ1)
margins highrentstates, at (democ=(0, 1.65, 2.3979))
Is this something I can execute in one command, or does it require a number of separate steps?
This is my first query to the listserv and I do appreciate hearing peoples’ answers.
Sincerely,
Alessandro Morosin
UC Riverside
Comment