Learn R Programming

robustbase (version 0.1-2)

modsel.glmrob: Robust Model Selection for "glmrob" Objects

Description

Compute a robust Wald-type or deviance-type Test, i.e., a robust test for multiple coefficients of an glmrob object.

Usage

modsel.glmrob(full.mfit, reduced.mfit, quad.form = FALSE,
             test = c("Wald", "Quasi-Deviance"))

Arguments

full.mfit
full model: object of class glmrob
reduced.mfit
reduced model: object of class glmrob
quad.form
indicates if quadratic approximation is used for calculating the test statistic - only for "Quasi-Deviance"-type.
test
a character string specifying the test statistic to be used. Can be one of "Wald"-type or "Quasi-Deviance"-type, with partial matching allowed.

Value

  • Basically, an object of class "htest", hence with the standard print methods for hypothesis tests. This is basically a list with components
  • statisticthe test statistic, according to ???
  • dfnumerator and denominator degrees of freedom.
  • data.nameextracted from input full.mfit.
  • alternative"two.sided", always.
  • p.valuethe P-value, using an F-test on statistic and df[1:2].

References

E. Cantoni and E. Ronchetti (2001) Robust Inference for Generalized Linear Models. JASA 96 (455), 1022--1030.

E.Cantoni (2004) Analysis of Robust Quasi-deviances for Generalized Linear Models. Journal of Statistical Software 10, http://www.jstatsoft.org

See Also

glmrob

Examples

Run this code
## Binomial response
data(carrots)
Cfit2 <- glmrob(cbind(success, total-success) ~ logdose + block,
                family=binomial, data=carrots, method="Mqle",
                control=glmrobMqle.control(tcc=1.2))
summary(Cfit2)

Cfit4 <- glmrob(cbind(success, total-success) ~ logdose * block,
                family=binomial, data=carrots, method="Mqle",
                control=glmrobMqle.control(tcc=1.2))

modsel.glmrob(Cfit4, Cfit2, test="Wald")

modsel.glmrob(Cfit4, Cfit2, test="Quasi-Deviance")

modsel.glmrob(Cfit4, Cfit2, test="Quasi-Deviance", quad.form=TRUE)

## Poisson response
data(epilepsy)

Efit2 <- glmrob(Ysum ~ Age10 + Base4*Trt, family=poisson, data=epilepsy,
               method="Mqle", control=glmrobMqle.control(tcc=1.2,maxit=100))
summary(Efit2)

Efit3 <- glmrob(Ysum ~ Age10 + Base4 + Trt, family=poisson, data=epilepsy,
               method="Mqle", control=glmrobMqle.control(tcc=1.2,maxit=100))

modsel.glmrob(Efit2, Efit3, test = "Wald")

modsel.glmrob(Efit2, Efit3, test = "Quasi-Deviance")

modsel.glmrob(Efit2, Efit3, test = "Quasi-Deviance", quad.form = TRUE)

Run the code above in your browser using DataLab