![Statalist](/includes/images/head_statalist.jpg) |
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Percent correctly predicted after Asclogit or Clogit
On Jun 30, 2008, at 11:24 AM, Luigi Curini wrote:
Hi Statalist!
any suggestions about calculating the percent correctly predicted
by a given
model after Asclogit or Clogit?
This question comes up many times.
The predicted proportions from -clogit- will not resemble sample
proportions, and therefore are not useful for estimating sensitivity,
specificity, ROC Curves, or other measures of correct prediction.
The probability modeled by -clogit- is not the unconditional
probability P(Y = 1 | X's), but a probability that is conditional on
the number of "events" in the matched set. The underlying model has
a different intercept for each set, and this intercept is not
estimated. The default prediction (pc1) is for the probability of
exactly one response in the subject's matched group, given the
subject's covariates. The optional prediction (pu0) is the
probability of response assuming that the group intercept is zero.
The predicted values and fit statistics produced after -clogit- can
be useful for detecting model failures.
-Steve
Here is code to illustrate the different kinds of predictions.
/*************CODE BEGINS*******************************/
use http://www.stata-press.com/data/r10/clogitid.dta, clear
gen x3 = x2-1 // Create a zero level for x2
logit y x1 x3 // unconditional logit
predict phat
clogit y x1 x3, group(id)
predict p1, pc1
predict p0, pu0
sum y phat p1 p0
/* Only the unconditional logit prediction resembles the sample
proportion */
sum p0 if x1==0 & x3==0 // p0 is 1/2 when the covariates equal 0
/***********CODE ENDS**************************/
*
* 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/