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   Amy Hsin <[email protected]>
To   [email protected]
Subject   Re: st: Margins error
Date   Sun, 1 Jul 2012 18:16:40 +0200

You may want to read the thread "generating predicted values for
growth models" that was posted yesterday.  I had similar problems with
the margins command using xi.

Maarten and William's suggest was to drop the xi (see the response for
details). That worked to a degree.

However, I am still having problems with the margins command to
generate predictions and am hoping to receive some help.

Amy

On Sun, Jul 1, 2012 at 5:39 PM, 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/



-- 
Amy Hsin
Assistant Professor of Sociology
Queens College, City University of New York
http://qcpages.qc.cuny.edu/~ahsin

*
*   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