| nestedHypotheses {nestedLogit} | R Documentation |
Hypothesis-Testing and Related Methods for "nestedLogit" Objects
Description
Various methods for testing hypotheses about nested logit models.
AnovaCalculates type-II or type-III analysis-of-variance tables for
"nestedLogit"objects; seeAnovain the car package.anovaComputes sequential analysis of variance (or deviance) tables for one or more fitted
"nestedLogit"objects; seeanova.linearHypothesisComputes Wald tests for linear hypotheses; see
linearHypothesisin the car package.logLikReturns the log-likelihood and degrees of freedom for the nested-dichotomies model. (and through it
AICandBICmodel-comparison statistics).
Usage
## S3 method for class 'nestedLogit'
Anova(mod, ...)
## S3 method for class 'Anova.nestedLogit'
print(x, ...)
## S3 method for class 'nestedLogit'
linearHypothesis(model, ...)
## S3 method for class 'nestedLogit'
anova(object, object2, ...)
## S3 method for class 'anova.nestedLogit'
print(x, ...)
## S3 method for class 'nestedLogit'
logLik(object, ...)
Arguments
... |
arguments to be passed down. In the case of |
x, object, object2, mod, model |
in most cases, an object of class |
Value
The
Anovaandanovamethods return objects of class"Anova.nestedLogit"and"anova.nestedLogit", respectively, each of which contains a list of"anova"objects (seeanova) and is usually printed.The
linearHypothesismethod is called for its side effect, printing the result of linear hypothesis tests, and invisibly returnsNULL.The
logLikmethod returns an object of class"logLik"(seelogLik).
Author(s)
John Fox
See Also
Anova, anova,
linearHypothesis, logLik, AIC,
BIC
Examples
# define continuation dichotomies for level of education
cont.dichots <- continuationLogits(c("l.t.highschool",
"highschool",
"college",
"graduate"))
# fit a nested model for the GSS data examining education degree in relation to parent & year
m <- nestedLogit(degree ~ parentdeg + year,
cont.dichots,
data=GSS)
# Anova and anova tests
car::Anova(m) # type-II (partial) tests
anova(update(m, . ~ . - year), m) # model comparison
# Wald test
car::linearHypothesis(m, c("parentdeghighschool", "parentdegcollege",
"parentdeggraduate"))
# log-liklihood, AIC, and BIC
logLik(m)
AIC(m)
BIC(m)