powered by
Internal, not usually called directly
metrics_hoslem(y, yhat, g = 10, digits = c(2, 3))
Character string of chi-sq result, df, and p-value. Significant p-value suggests poor fit.
Observed y, usually of the form fit$y.
fit$y
Predicted y_hat, usually for the form fit$fitted
fit$fitted
Number of bins to calculate quantiles.
Number of decimal places of form c(2,3), where digits[1] is for chi-sq estimate and digits[2] is for p-value.
c(2,3)
digits[1]
digits[2]
Adapted from Peter Solymos.
fit = glm(mort_5yr~age.factor+extent.factor, data=colon_s, family="binomial") metrics_hoslem(fit$y, fit$fitted)
Run the code above in your browser using DataLab