[R] two kind of Hosmer and Lemeshow’s test

2008-11-07 Thread leo_wa

I know that there are two method to apply the Hosmer and Lemeshow’s.  One of
them is calculated based on the fixed and pre-determined cut-off points of
the estimated probability of success.  One of them is calculated based on
the percentiles of estimated probabilities.  
In the previous post,i find that the Hosmer and Lemeshow’s test how to use
in R.
hosmerlem <-
function (y, yhat, g = 10) 
{
cutyhat <- cut(x, breaks = quantile(yhat, probs = seq(0, 
1, 1/g)), include.lowest = T)
obs <- xtabs(cbind(1 - y, y) ~ cutyhat)
expect <- xtabs(cbind(1 - yhat, yhat) ~ cutyhat)
chisq <- sum((obs - expect)^2/expect)
P <- 1 - pchisq(chisq, g - 2)
c("X^2" = chisq, Df = g - 2, "P(>Chi)" = P)
}
I want to know how can i use the another method which is not use the
probability of success. i want to know how can i revise above program to
achieve an objective.
-- 
View this message in context: 
http://www.nabble.com/two-kind-of-Hosmer-and-Lemeshow%E2%80%99s-test-tp20380578p20380578.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] two kind of Hosmer and Lemeshow’s test

2008-11-07 Thread Frank E Harrell Jr

leo_wa wrote:

I know that there are two method to apply the Hosmer and Lemeshow’s.  One of
them is calculated based on the fixed and pre-determined cut-off points of
the estimated probability of success.  One of them is calculated based on
the percentiles of estimated probabilities.  


Both of these methods have been made obsolete by methods that do not 
require any arbitrary groupings of predicted probabilities.  See the 
residuals.lrm function in the Design package and the reference in its 
help file, to the Hosmer paper.


Frank


In the previous post,i find that the Hosmer and Lemeshow’s test how to use
in R.
hosmerlem <-
function (y, yhat, g = 10) 
{
cutyhat <- cut(x, breaks = quantile(yhat, probs = seq(0, 
1, 1/g)), include.lowest = T)

obs <- xtabs(cbind(1 - y, y) ~ cutyhat)
expect <- xtabs(cbind(1 - yhat, yhat) ~ cutyhat)
chisq <- sum((obs - expect)^2/expect)
P <- 1 - pchisq(chisq, g - 2)
c("X^2" = chisq, Df = g - 2, "P(>Chi)" = P)
}
I want to know how can i use the another method which is not use the
probability of success. i want to know how can i revise above program to
achieve an objective.



--
Frank E Harrell Jr   Professor and Chair   School of Medicine
 Department of Biostatistics   Vanderbilt University

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.