Statalist The Stata Listserver


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

RE: st: Predict and adjust


From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   RE: st: Predict and adjust
Date   Tue, 2 Jan 2007 14:40:24 -0600

> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Tim Wade
> Sent: Thursday, December 28, 2006 9:16 AM
> To: [email protected]
> Subject: Re: st: Predict and adjust
> 
> Maarten, thanks for this article it is very helpful.  I also just
> wanted to point out that if you use adjust to generate predicted
> probabilities based on each individual covariate pattern in the
> example  Fred provided where no variables or by variables are
> specified in the adjust command, the results are the same as those
> obtained from predict. There appear to be some very slight
> differences, but I would imagine these are just artificats resulting
> from the calculations (rounding or precision). To my understanding,
> they should be the same.

If you open up -adjust- and search and replace "_predict" with "_predict
double" and save as -myadjust- the differences disappear.


. do "C:\DOCUME~1\Scott_2\LOCALS~1\Temp\STD0i000000.tmp"

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

. qui xi: logistic low age lwt i.race smoke,nolog

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

. qui myadjust,pr gen(p2)
 
. /*probabilities from adjust and predict are equal to 6 decimal places*/ 
. assert round(p, 0.000001)==round(p2, 0.000001)

. assert round(p, 0.0000001)==round(p2, 0.0000001)

. list p p2 if p~=p2

. 
end of do-file


Scott



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