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: Bug in margins


From   Joe Canner <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: st: Bug in margins
Date   Fri, 30 Aug 2013 15:58:48 +0000

Roland,

The requirement that the original model be specified including "i." is also buried deep in the PDF documentation for -margins- (page 1063 of r.pdf).  The original model runs fine because binary variables don't need the "i.", but for whatever reason -margins- requires it.

Joe Canner
Johns Hopkins University School of Medicine

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Richard Williams
Sent: Friday, August 30, 2013 12:51 PM
To: [email protected]; [email protected]
Subject: Re: st: Bug in margins

First off, your 2 logistic commands look identical to me. I'm guessing that when you ran it the first time and got the error, you did not have the i.

Assuming that is the case, this is no error. The i. tells Stata that the variable is categorical rather than continuous. See the help for margins. Or, for some highlights on the margins command, see

http://www3.nd.edu/~rwilliam/stats/Margins01.pdf



At 10:39 AM 8/30/2013, roland andersson wrote:
>I am analysing a logistic regression model, binary outcome. I want to 
>analyse the adjusted proportion of the outcome for a binary (0/1) 
>covariate.
>
>I run the logistic model followed by margins . logistic dod30dgr  
>i.lapscopiintent alder aldersq........
>. margins lapscopiintent
>
>I get an error
>'lapscopiintent' not found in list of covariates r(322);
>
>If I put i. before the binary variable I am interested in
>
>. logistic dod30dgr  i.lapscopiintent alder aldersq................
>. margins lapscopiintent
>
>Predictive margins Number of obs   = 166811
>Model VCE    : OIM
>
>Expression   : Pr(dod30dgr), predict()
>
>Delta-method
>Margin   Std. Err. z P>z [95% Conf. Interval]
>lapscopiin~t
>0     .0015466   .0000985 15.70 0.000 .0013535 .0017397
>1     .0011487   .0002518 4.56 0.000 .0006552 .0016421
>
>I assume this is a bug?
>
>Roland Andersson
>*
>*   For searches and help try:
>*   http://www.stata.com/help.cgi?search
>*   http://www.stata.com/support/faqs/resources/statalist-faq/
>*   http://www.ats.ucla.edu/stat/stata/

-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  [email protected]
WWW:    http://www.nd.edu/~rwilliam

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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