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

# st: RE: adjust vs. margins revisited

 From "Feiveson, Alan H. (JSC-SK311)" To "statalist@hsphsun2.harvard.edu" Subject st: RE: adjust vs. margins revisited Date Fri, 30 Jul 2010 11:21:26 -0500

```ROb - I think -margins- can be made to give correct confidence limits if you use something like eyex instead of dydx.

Al

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Tim Wade
Sent: Friday, July 30, 2010 11:08 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: adjust vs. margins revisited

Hello Statalisters:

Having recently upgradted to v. 11, I have been testing  -margins-
and, like others have discussed on Statalist, I am trying to reconcile
some results compared to the old -adjust-

Here is a simplified example

sysuse auto.dta
logistic foreign  price mpg weight
adjust price=4000 mpg weight, pr ci
margins, atmeans at(price=4000)

produces the following:

. adjust price=4000 mpg weight, pr ci

-----------------------------------------------------------------------------------------------------------------------------------------
Dependent variable: foreign     Equation: foreign     Command: logistic
Covariates set to mean: mpg = 21.297297, weight = 3019.4595
Covariate set to value: price = 4000
-----------------------------------------------------------------------------------------------------------------------------------------

----------------------------------------------
All |         pr          lb          ub
----------+-----------------------------------
|    .005861    [.000219    .137016]
----------------------------------------------
Key:  pr         =  Probability
[lb , ub]  =  [95% Confidence Interval]

. margins, atmeans at(price=4000)

Adjusted predictions                              Number of obs   =         74
Model VCE    : OIM

Expression   : Pr(foreign), predict()
at           : price           =        4000
mpg             =     21.2973 (mean)
weight          =    3019.459 (mean)

------------------------------------------------------------------------------
|            Delta-method
|     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
_cons |   .0058613   .0097907     0.60   0.549    -.0133281    .0250508
------------------------------------------------------------------------------

(http://www.stata.com/statalist/archive/2009-11/msg00199.html where he
stated:

"The -pr- confidence intervals from -adjust- are computed by transforming the
end-points of the CI limits from the linear prediction.

-margins- computes the CI limits using the normal approximation is valid."

but here margins produces negative confidence bounds on a probability
and also produces quite different results from -adjust-, which seems
to provide reasonable results. It does not seem plausible that both
results could be considered valid. Any thoughts?

Kind regards, Tim
*
*   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/
```