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]
AW: st: Margins error
From
Reinhardt Jan Dietrich <[email protected]>
To
"[email protected]" <[email protected]>
Subject
AW: st: Margins error
Date
Sun, 1 Jul 2012 16:24:45 +0000
You may try with the "over" option in the second case which will produce margins at group means of p_misdcon_cat if not specified otherwise ...
try
margins, at (_Irace_eth__2=1 male=1 p_felcon=0 arrestnum_cat=4 MisdArr=1) over (p_misdcon_cat)
Best
Jan
________________________________________
Von: [email protected] [[email protected]]" im Auftrag von "Amy Hsin [[email protected]]
Gesendet: Sonntag, 1. Juli 2012 18:16
An: [email protected]
Betreff: Re: st: Margins error
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/
*
* 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/