
Last chance! 50% off unlimited learning
Sale ends in
anova.gnm(object, ..., dispersion = NULL, test = NULL)
gnm
gnm
or glm
object
"Chisq"
, "F"
, or "Cp"
. See
stat.anova
."anova"
inheriting from class "data.frame"
.na.action = na.omit
is used; an error will be given in this case.test
is specified, the table will include test statistics
and/or p values for the reduction in deviance. For models with known
dispersion (e.g., binomial and Poisson fits) the chi-squared test is
most appropriate, and for those with dispersion estimated by moments
(e.g., 'gaussian', 'quasibinomial' and 'quasipoisson' fits) the F test
is most appropriate. Mallows' Cp statistic is the residual deviance
plus twice the estimate of $\sigma^2$ times the residual degrees of
freedom, which is closely related to AIC (and a multiple of it if the
dispersion is known).gnm
, anova
set.seed(1)
data(occupationalStatus)
## Fit a uniform association model separating diagonal effects
Rscore <- scale(as.numeric(row(occupationalStatus)), scale = FALSE)
Cscore <- scale(as.numeric(col(occupationalStatus)), scale = FALSE)
Uniform <- glm(Freq ~ origin + destination + Diag(origin, destination) +
Rscore:Cscore, family = poisson, data = occupationalStatus)
## Fit an association model with homogeneous row-column effects
RChomog <- gnm(Freq ~ origin + destination + Diag(origin, destination) +
Nonlin(MultHomog(origin, destination)), family = poisson,
data = occupationalStatus)
## Fit an association model with separate row and column effects
RC <- gnm(Freq ~ origin + destination + Diag(origin, destination) +
Mult(origin, destination), family = poisson,
data = occupationalStatus)
anova(RC, test = "Chisq")
anova(Uniform, RChomog, RC, test = "Chisq")
Run the code above in your browser using DataLab