Description Usage Arguments Details Value Author(s) References Examples
Goodness-of-fit tests for GLMs for binary data including the Hosmer-Lemeshow decile test and X-squared test with normal approximation.
1 2 3 4 5 6 7 8 9 10 11 12 |
object |
An |
x |
An |
method |
The type of Hosmer-Lemeshow test to be performed. The
|
decile.type |
The quantile computation method; see |
digits |
the desired number of printed digits |
... |
currently not used |
These tests are known to have very low power. They are only appropriate when the fitted frequencies are very low and when the covariate pattern dictates strictly binary observations.
For HLtest.Rsq
an object of class HLtest.Rsq
with
components
expected |
the expected frequencies in the 2 x 10 entries |
observed |
the observed frequencies in the 2 x 10 entries |
resid |
Pearson residuals |
X2 |
the Pearson X-squared statistic |
p.value |
the p-value for the goodness-of-fit test |
method |
the method used for the test |
For X2GOFtest
an object of class X2GOFtest
with
components
p.value |
the p-value for the goodness-of-fit test |
z.score |
the standardized z-score for the goodness-of-fit test |
RSS |
the residual sums of squares term |
X2 |
the pearson chi-squared statistic |
Rune Haubo B Christensen
Hosmer, D.W. and Lemeshow, S. (1980). Goodness of fit tests for the multiple logistic regression model. Communications in Statistics - Theory and Methods, A9(10), p. 1043-1069.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Lifted from example(predict.glm):
ldose <- rep(0:5, 2)
numdead <- c(1, 4, 9, 13, 18, 20, 0, 2, 6, 10, 12, 16)
sex <- factor(rep(c("M", "F"), c(6, 6)))
SF <- cbind(numdead, numalive=20-numdead)
budworm.lg <- glm(SF ~ sex*ldose, family=binomial)
## summary(budworm.lg)
(Rsq.budworm <- Rsq(budworm.lg))
HLtest(Rsq.budworm)
HLtest(Rsq.budworm, method="fixed")
X2GOFtest(Rsq.budworm)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.