Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: -adjust- command with pr after logistic not giving correct output?


From   Kaleb Michaud <[email protected]>
To   [email protected]
Subject   st: -adjust- command with pr after logistic not giving correct output?
Date   Tue, 21 Jan 2003 19:01:28 -0600

There appears to be a problem with either my interpretation of what output the -adjust- command should give or in the actual program itself. It only shows itself when using the pr (probability) option after a logistic command (used in this example).

Below I've used a sample Stata data set (census), created a binary variable (longer) and then did a logistic using a single dependent variable (medage). I then use -predict- with the pr option to create the p1 variable. Using -adjust- without setting any values and using the pr option, I generate the a1 variable and the output from -adjust- is by a small categorical variable (region). Lastly, I display the average values of p1 and a1 by region (using -tabstat-) and they are exactly the same, but they differ from the output from -adjust-.

Though the numbers seem similar, I am getting much larger and important differences (~0.005) with my dataset of >10K observations. Also, doing these examples with the xb option gives output that are exactly the same - the problem seems limited to the pr option.

I look forward to any advice you can give.
Sincerely,
Kaleb Michaud
Arthritis Research Center


. use census
(1980 Census data by state)

. gen longer = length(state)

. recode longer min/8=0 9/max=1
(50 changes made)

. logistic longer medage

Logit estimates Number of obs = 50
LR chi2(1) = 0.58
Prob > chi2 = 0.4481
Log likelihood = -32.915529 Pseudo R2 = 0.0087

------------------------------------------------------------------------------
longer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
medage | 1.143314 .2048402 0.75 0.455 .8047506 1.624314
------------------------------------------------------------------------------

. predict p1 if e(sample), pr

. adjust, by(region) pr gen(a1)

------------------------------------------------------------------------------
Dependent variable: longer Command: logistic
Created variable: a1
Variable left as is: medage
------------------------------------------------------------------------------

----------------------
Census |
region | pr
----------+-----------
NE | .433217
N Cntrl | .37812
South | .381077
West | .339917
----------------------
Key: pr = Probability

. tabstat p1 a1 medage, by(region)

Summary statistics: mean
by categories of: region (Census region)

region | p1 a1 medage
--------+------------------------------
NE | .4335186 .4335186 31.23333
N Cntrl | .3783487 .3783487 29.525
South | .3821012 .3821012 29.61875
West | .3418868 .3418868 28.28462
--------+------------------------------
Total | .38 .38 29.54
---------------------------------------


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