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

Re: st: Logit question

From   Maarten buis <>
Subject   Re: st: Logit question
Date   Wed, 11 Jun 2008 07:19:59 +0100 (BST)

--- Plamen Nikolov <> 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 )

Hope this helps,

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

Sent from Yahoo! Mail.
A Smarter Email
*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index