Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: post-regression diagnostics for LPM


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index