--- Plamen Nikolov <[email protected]> wrote:
> I have a quick question about logit in Stata. I am running a logit
> regression on 1000 observations. I save the coefficient estimates of
> the logit. What will be the most efficient way to apply the estimates
> to a new dataset to generate a new set of predicted probability for
> the new dataset observations?
The easiest way, is to estimate your -logit- in the first dataset, open
the second dataset, and than use -predict-. All you need to watch out
for is that all variables you used in your -logit- model are also
present in your second dataset. See the example below:
*----------------------- begin example --------------------
// make two files
tempfile a b
sysuse auto, clear
gen good = rep78 > 3 if rep78 < .
keep if foreign == 1
save `a'
sysuse auto, clear
keep if foreign == 0
save `b'
// estimate logit
use `a', clear
logit good gear_ratio turn
// calculate scores in file b
use `b', clear
predict pr
*-------------------- 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 )
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/
-----------------------------------------
__________________________________________________________
Sent from Yahoo! Mail.
A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html
*
* 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/