Hi all,
I received the following query via email; I'm posting it and my reply in case they are helpful to someone else some day.
I'm currently working with logistic regresion models. I'd like to use combomarginsplot to graph both the unadjusted and covariate-adjusted average marginal effects of a variable in an interaction term.
Here is the syntax I used to compute the unadjusted average effects for a given racial/ethnic group:
And here is the syntax used to compute the covariate-adjusted average effects:
I then tried...
...which returned a 'file 2 _u_at_vars don't match file 1' error.
What am I doing wrong? Does combomarginsplot lack the ability to plot baseline and covariate-fixed estimates of average effects? (should I send you sample data?)
I received the following query via email; I'm posting it and my reply in case they are helpful to someone else some day.
I'm currently working with logistic regresion models. I'd like to use combomarginsplot to graph both the unadjusted and covariate-adjusted average marginal effects of a variable in an interaction term.
Here is the syntax I used to compute the unadjusted average effects for a given racial/ethnic group:
Code:
logit spending_police_decrease RACE##c.log_viocrime_zipZ##c.bsZ if party3==1 [pweight=weight_post], cluster(inputstate_post) margins , dydx(bsZ) at(RACE=(1) log_viocrime_zipZ =(-3(1)3)) saving(whdem_defund_bsZxzip)
Code:
logit spending_police_decrease RACE##c.log_viocrime_zipZ##c.bsZ i.ideo7 i.party7 age_post i.educ5 i.faminc_new i.region9_post i.urbancity i.marital numchild18 ownhome i.immstat if party3==1 [pweight=weight_post], cluster(inputstate_post) margins , dydx(bsZ) at(RACE=(1) log_viocrime_zipZ=(-3(1)3) ideo7=(2) party7=(1) age_post=(52) faminc_new=(7) educ5=(3) region9_post=(5) urbancity=(2) marital=(1) numchild18=(0) ownhome=(1) immstat=(5)) saving(whdem_defund_bsZxzip_kitchsink)
Code:
combomarginsplot whdem_defund_bsZxzip whdem_defund_bsZxzip_kitchsink
What am I doing wrong? Does combomarginsplot lack the ability to plot baseline and covariate-fixed estimates of average effects? (should I send you sample data?)
Comment