Dear R - help,

I am working on the Credit scorecard model. I am using the Logistic regression to arrive at the regression coefficients model.

I want to use the Hosmer - Lemeshow test . 

In order to understand the use of R - language, I had referred the following URL 

      http://www.stat.sc.edu/~hitchcock/diseaseoutbreakRexample704.txt

The related data 'diseaseoutbreak' is available at the following URL

       http://www.stat.sc.edu/~hitchcock/diseaseoutbreakdata.txt

The R code as mentioned therein is

####
# A function to do the Hosmer-Lemeshow test in R.
# R Function is due to Peter D. M. Macdonald, McMaster University.
# 
hosmerlem <-
function (y, yhat, g = 10) 
{
    cutyhat <- cut(yhat, 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)
}
#
######

# Doing the Hosmer-Lemeshow test
# (after copying the above function into R):

hosmerlem(disease, fitted(disease.logit))
However when I ran these commands / functions in R, I got following errors

Error in model.frame.default(formula = cbind(1 - y, y) ~ cutyhat) : 
  invalid type (list) for variable 'cbind(1 - y, y)'

Can anyone please guide me as to how to run Hosmer- Lemeshow test, as also how to find out the other usual logistic regression related "Log - likelihood, AIC, Pseudo R etc"?

Thanking you all in advance

Saggak





      Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/
	[[alternative HTML version deleted]]

