Description Usage Arguments Value Note See Also Examples
Significance tests for a
binary regression models fit with glm
1 2 3 4 |
x |
A regression model with class |
... |
Not used. |
test |
What to test.
|
A list
of data.table
s as follows:
Wald |
The Wald test for each coefficient which is: W = B / SE[B] This should be normally distributed. |
LR |
The likelihood ratio test for each coefficient: LR = -2 * log(likelihood without / likelihood with variable) which is: LR = -2 * SUM(y * log(P / y) + (1 - y) * log((1 - P) / (1 - y))) When comparing a fitted model to a saturated model (i.e. P[i]=y[i] and likelihood =1), the LR is referred to as the model deviance, D. |
score |
The score test, also known as the
Rao, Cochran-Armitage trend and the Lagrange multiplier test.
ybar = (SUM y[i]) / n and xbar = (SUM x[i] * n[i]) / n The statistic is: ST = SUM x[i](y[i] - ybar) / (ybar(1 - ybar) SUM (x[i] - xbar)^2)^0.5 If the value of the coefficient is correct, the test should follow a standard normal distribution. |
The result has the class
"sig.glm"
.
The print
method for this class
shows only
the model coefficients and p values.
?aod::wald.test
?statmod::glm.scoretest
For corrected score tests:
?mdscore::mdscore
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | data(ageChd)
## H&L 2nd ed. Table 1.3. Page 10.
summary(g1 <- glm(chd ~ age, data=ageChd, family=binomial))
sig(g1)
data(lbw)
## Table 2.2. Page 36.
summary(g2 <- glm(LOW ~ AGE + LWT + RACE + FTV,
data=lbw, family=binomial))
sig(g2)
## Table 2.3. Pages 38-39.
summary(g3 <- glm(LOW ~ LWT + RACE,
data=lbw, family=binomial))
sig(g3, test="coef")
## RACE is more significant when dropped as a factor
##
sig(g3, test="var")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.