survey (version 3.9-1)

regTermTest: Wald test for a term in a regression model

Description

Provides a Wald 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.

Usage

regTermTest(model, test.terms, null=NULL,df=Inf)

Arguments

model
A model object with coef and vcov methods
test.terms
Character string or one-sided 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 NULL these are estimated from the model

Value

  • An object of class regTermTest.

See Also

anova, vcov, contrasts

Examples

Run this code
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(api00~ell+meals+mobility, design=dclus2)
 regTermTest(model2, ~ell)
 regTermTest(model2, ~ell,df=NULL)

Run the code above in your browser using DataLab