Description Usage Arguments Value Note References See Also Examples
Provides Wald test and working likelihood ratio (RaoScott) test of the
hypothesis that all coefficients associated with a particular
regression term are zero (or have some other specified
values). Particularly useful as a substitute for anova
when not fitting by maximum likelihood. The Wald tests use a
chisquared or F distribution, the LRT uses a linear combination of
chisquared or F distributions as in pchisqsum
.
1 2  regTermTest(model, test.terms, null=NULL,df=NULL,
method=c("Wald","LRT"), lrt.approximation="saddlepoint")

model 
A model object with 
test.terms 
Character string or onesided formula giving name of term or terms to test 
null 
Null hypothesis values for parameters. Default is zeros 
df 
Denominator degrees of freedom for an F test. If

method 
If 
lrt.approximation 
method for approximating the distribution of
the LRT statistic; see 
An object of class regTermTest
or regTermTestLRT
.
The "LRT"
method will not work if the model had starting values supplied for the regression coefficients. Instead, fit the two models separately and use anova(model1, model2, force=TRUE)
Rao, JNK, Scott, AJ (1984) "On Chisquared Tests For Multiway Contingency Tables with Proportions Estimated From Survey Data" Annals of Statistics 12:4660.
Lumley T, Scott A (2012) "Partial likelihood ratio tests for the Cox model under complex sampling" Statistics in Medicine 17 JUL 2012. DOI: 10.1002/sim.5492
Lumley T, Scott A (2014) "Tests for Regression Models Fitted to Survey Data" Australian and New Zealand Journal of Statistics 56:114 DOI: 10.1111/anzs.12065
anova
, vcov
, contrasts
,pchisqsum
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  data(esoph)
model1 < glm(cbind(ncases, ncontrols) ~ agegp + tobgp *
alcgp, data = esoph, family = binomial())
anova(model1)
regTermTest(model1,"tobgp")
regTermTest(model1,"tobgp:alcgp")
regTermTest(model1, ~alcgp+tobgp:alcgp)
data(api)
dclus2<svydesign(id=~dnum+snum, weights=~pw, data=apiclus2)
model2<svyglm(I(sch.wide=="Yes")~ell+meals+mobility, design=dclus2, family=quasibinomial())
regTermTest(model2, ~ell)
regTermTest(model2, ~ell,df=NULL)
regTermTest(model2, ~ell, method="LRT", df=Inf)
regTermTest(model2, ~ell+meals, method="LRT", df=NULL)

Loading required package: grid
Loading required package: Matrix
Loading required package: survival
Attaching package: 'survey'
The following object is masked from 'package:graphics':
dotchart
Analysis of Deviance Table
Model: binomial, link: logit
Response: cbind(ncases, ncontrols)
Terms added sequentially (first to last)
Df Deviance Resid. Df Resid. Dev
NULL 87 227.241
agegp 5 88.128 82 139.112
tobgp 3 19.085 79 120.028
alcgp 3 66.054 76 53.973
tobgp:alcgp 9 6.489 67 47.484
Wald test for tobgp
in glm(formula = cbind(ncases, ncontrols) ~ agegp + tobgp * alcgp,
family = binomial(), data = esoph)
F = 3.961947 on 3 and 67 df: p= 0.011609
Wald test for tobgp:alcgp
in glm(formula = cbind(ncases, ncontrols) ~ agegp + tobgp * alcgp,
family = binomial(), data = esoph)
F = 0.6895049 on 9 and 67 df: p= 0.71583
Wald test for alcgp alcgp:tobgp
in glm(formula = cbind(ncases, ncontrols) ~ agegp + tobgp * alcgp,
family = binomial(), data = esoph)
F = 5.021884 on 12 and 67 df: p= 7.0226e06
Wald test for ell
in svyglm(formula = I(sch.wide == "Yes") ~ ell + meals + mobility,
design = dclus2, family = quasibinomial())
F = 6.055448 on 1 and 36 df: p= 0.018792
Wald test for ell
in svyglm(formula = I(sch.wide == "Yes") ~ ell + meals + mobility,
design = dclus2, family = quasibinomial())
F = 6.055448 on 1 and 36 df: p= 0.018792
Working (RaoScott) LRT for ell
in svyglm(formula = I(sch.wide == "Yes") ~ ell + meals + mobility,
design = dclus2, family = quasibinomial())
Working 2logLR = 6.781297 p= 0.0096772
df=1
Working (RaoScott+F) LRT for ell meals
in svyglm(formula = I(sch.wide == "Yes") ~ ell + meals + mobility,
design = dclus2, family = quasibinomial())
Working 2logLR = 4.692659 p= 0.11957
(scale factors: 1.6 0.37 ); denominator df= 36
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.