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

st: Adjust command ?error


From   Fred Wolfe <[email protected]>
To   [email protected]
Subject   st: Adjust command ?error
Date   Wed, 22 Jan 2003 04:18:05 -0600

As a follow-up to Kaleb Michauds posting on an seeming problem with -adjust-, this grew out of a further analysis of a manuscript we had just submitted where we subsequently obtained a counterintuitive result using adjust. We are working at the level of adjusted probabilities of 0.02 to 0.03, where such a difference (probability of illness) is very important. To try to understand what was happening, we worked through a series of adjustments using and not using adjust. We found an inconsistency between manual adjustments (as per Stata manuals) and -adjust- adjustments only following logistic regression and adjust using the -pr- option, but not the -xb- option. We thought there was problem in the conversion from xb to pr within adjust (actually, in the xb value that adjust converts). Adjust is a complicated program and we couldn't see any clear errors in the code. We think there is an error in the program, but we might be wrong. As our manuscript has a table in it that relies on adjust, this is an issue of some importance to us (and others).

Thanks,

Fred


At 07:01 PM 1/21/2003 -0600, you wrote:

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- using the -pr- option (but not the xb option).

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/

---------------------------------------------------------------------------- ------------------------
Fred Wolfe Tel (316) 263-2125
National Data Bank for Rheumatic Diseases Fax (316) 263-0761
Wichita, Kansas [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