Statalist


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

st: RE: Postfile results of the adjust command


From   "Maarten Buis" <[email protected]>
To   <[email protected]>
Subject   st: RE: Postfile results of the adjust command
Date   Thu, 2 Aug 2007 13:50:46 +0200

--- Patrick Musonda wrote:
> I am using stata 9, I was wondering whether anyone knows how stata stores
> the results after the adjust command so that we can postfile them later.

Stata doesn't store any results after -adjust-. You'll probably have to
write some code that does whatever you want -adjust- to do and save the 
results. If you are using a model other than -regress- you have to take
care to take the means of the predicted linear predictors first and than
transform them to the desired metric, in order to exactly reproduce the
results from -adjust-. See the example below and (Buis 2007) 

*--------- begin example ------------
sysuse auto, clear

reg pri mpg
adjust ,by(rep78) 
predict xb, xb
levelsof rep78
local levs "`r(levels)'"
foreach i of local levs {
	sum xb if rep78 == `i'
}
drop xb

logit foreign mpg
adjust ,by(rep78) pr

predict xb, xb
levelsof rep78
local levs "`r(levels)'"
foreach i of local levs {
	sum xb if rep78 == `i', meanonly
	di %9.6g invlogit(`r(mean)')
}
*------------ end example --------------
(For more on how to use examples I sent to the Statalist, see
http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html )

M.L. Buis (2007), "predict and adjust with logistic regression", 
The Stata Journal, 7(2), pp. 221-226
A prepublication draft can be found here: 
http://home.fsw.vu.nl/m.buis/wp/logit_adjust.html

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology 
Vrije Universiteit Amsterdam 
Boelelaan 1081 
1081 HV Amsterdam 
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434 

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------



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