Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: post-regression diagnostics for LPM
From
Maarten buis <[email protected]>
To
[email protected]
Subject
Re: st: post-regression diagnostics for LPM
Date
Fri, 8 Apr 2011 14:55:00 +0100 (BST)
--- On Fri, 8/4/11, traumaprof wrote:
> I need to compute the percent of predicted probabilities
> that fall outside the 0-1 range in order to tell whether
> LPM will work for a data set. Any recommended commands?
*------------- begin example ------------------
sysuse auto, clear
// predict linear probability model
reg foreign mpg i.rep78, robust
// get predicted probabilities
predict pr if e(touse)
// compute % invalid predictions
// r(N) is returned by -count-
// e(N) is returned by -regress-
count if pr < 0 | (pr > 1 & pr < .)
di r(N) / e(N) * 100
// graphing the predicted probabilities
// is much more informative
separate pr, by(rep78)
scatter pr? mpg, yline(0 1)
*------------- end example ---------------
(For more on examples I sent to the Statalist see:
http://www.maartenbuis.nl/example_faq )
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://www.maartenbuis.nl
--------------------------
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/