Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Predict and adjust


From   Fred Wolfe <[email protected]>
To   <[email protected]>
Subject   st: Predict and adjust
Date   Sat, 23 Dec 2006 06:25:53 -0600

I know this has come up on the Stata list before, but in somewhat different form. I wonder if someone could explain the following to me.

The manual and the FAQ state that the results after predict and adjust are the same for the following circumstances, and they site this analysis that I have rerun.

. sysuse auto, clear
(1978 Automobile Data)

. regress mpg weight length foreign

Source | SS df MS Number of obs = 74
-------------+------------------------------ F( 3, 70) = 48.10
Model | 1645.2889 3 548.429632 Prob > F = 0.0000
Residual | 798.170563 70 11.4024366 R-squared = 0.6733
-------------+------------------------------ Adj R-squared = 0.6593
Total | 2443.45946 73 33.4720474 Root MSE = 3.3767

------------------------------------------------------------------------------
mpg | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
weight | -.0043656 .0016014 -2.73 0.008 -.0075595 -.0011718
length | -.0827432 .0547942 -1.51 0.136 -.1920267 .0265403
foreign | -1.707904 1.06711 -1.60 0.114 -3.836188 .4203806
_cons | 50.53701 6.245835 8.09 0.000 38.08009 62.99394
------------------------------------------------------------------------------

. predict p, xb

. su p

Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
p | 74 21.2973 4.747442 10.12822 30.51564

. su mpg

Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
mpg | 74 21.2973 5.785503 12 41

. adjust

---------------------------------------------------------------------------
Dependent variable: mpg Command: regress
Variables left as is: weight, length, foreign
---------------------------------------------------------------------------

----------------------
All | xb
----------+-----------
| 21.2973
----------------------
Key: xb = Linear Prediction


The above shows that adjust and predict produce the same results.

However, when I use the logistic regression example from page 20 (Reference A-J) for the adjust command, predict and adjust give different results, as shown below. Can someone help me to understand why this is so and what I might do to obtain the same results using adjust.

Thanks,

Fred



. use http://www.stata-press.com/data/r9/lbw,clear
(Hosmer & Lemeshow data)

. xi: logistic low age lwt i.race smoke,nolog
i.race _Irace_1-3 (naturally coded; _Irace_1 omitted)

Logistic regression Number of obs = 189
LR chi2(5) = 20.08
Prob > chi2 = 0.0012
Log likelihood = -107.29639 Pseudo R2 = 0.0856

------------------------------------------------------------------------------
low | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
age | .9777443 .0334083 -0.66 0.510 .9144097 1.045466
lwt | .9875761 .006305 -1.96 0.050 .9752956 1.000011
_Irace_2 | 3.425372 1.771281 2.38 0.017 1.243215 9.437768
_Irace_3 | 2.5692 1.069301 2.27 0.023 1.136391 5.808555
smoke | 2.870346 1.09067 2.77 0.006 1.363 6.044672
------------------------------------------------------------------------------

. tab low

birthweight |
<2500g | Freq. Percent Cum.
------------+-----------------------------------
0 | 130 68.78 68.78
1 | 59 31.22 100.00
------------+-----------------------------------
Total | 189 100.00

. predict p
(option p assumed; Pr(low))

. su p

Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
p | 189 .3121693 .1481592 .0471794 .7063822


. adjust,pr

-------------------------------------------------------------------------------
Dependent variable: low Command: logistic
Variables left as is: age, lwt, smoke, _Irace_2, _Irace_3
-------------------------------------------------------------------------------

----------------------
All | pr
----------+-----------
| .289227
----------------------
Key: pr = Probability


Fred Wolfe
National Data Bank for Rheumatic Diseases
Wichita, Kansas
Tel +1 316 263 2125
[email protected]


*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index