Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Margins error


From   William Buchanan <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Margins error
Date   Sun, 1 Jul 2012 08:57:54 -0700

Assuming you are using Stata 12, you might want to try dropping the -xi:- prefix to your command.  You'll still want to keep the -i.- prefix for your variables.

HTH,
Billy

Sent from my iPhone

On Jul 1, 2012, at 8:39, Issa Kohler-Hausmann <[email protected]> wrote:

> Hello - 
> 
> I am sorry if this is a dumb question but I have having trouble with the "margins" command after running a logistic regression and I cannot figure out what I am misunderstanding. 
> 
> I am trying to graph the effect of the number of misdemeanor convictions (p_misdcon_cat) on the likelihood of conviction to a misdemeanor crime (outcome --> convict_Misd). The problem (it seems to me) is that STATA does not recognize the variables for purposes of the margins command that were generated using xi. logit and I don't know any other way of doing this. It also seems from all of the examples online that this should work. 
> 
> I ran the following logic model:
> 
> . xi: logit convict_Misd i.race_eth_cat male p_felcon i.p_misdcon_cat arrestnum_cat MisdArr, cluster(my_case_id)
> 
> I then get the following errors when I try the margins command evaluated at specified levels of my covariates. 
> 
> . margins, dydx(p_misdcon_cat) at (_Irace_eth__2=1 male=1 p_felcon=0 arrestnum_cat=4 MisdArr=1)
> 'p_misdcon_cat' not found in list of covariates
> r(322);
> 
> . 
> . margins p_misdcon_cat, at (_Irace_eth__2=1 male=1 p_felcon=0 arrestnum_cat=4 MisdArr=1)
> 'p_misdcon_cat' not found in list of covariates
> r(322);
> 
> Any help would be greatly appreciated!
> 
> Thank you
> 
> 
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index