nestedHypotheses {nestedLogit} | R Documentation |
Hypothesis-Testing and Related Methods for "nestedLogit"
Objects
Description
Various methods for testing hypotheses about nested logit models.
Anova
Calculates type-II or type-III analysis-of-variance tables for
"nestedLogit"
objects; seeAnova
in the car package.anova
Computes sequential analysis of variance (or deviance) tables for one or more fitted
"nestedLogit"
objects; seeanova
.linearHypothesis
Computes Wald tests for linear hypotheses; see
linearHypothesis
in the car package.logLik
Returns the log-likelihood and degrees of freedom for the nested-dichotomies model. (and through it
AIC
andBIC
model-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
Anova
andanova
methods 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
linearHypothesis
method is called for its side effect, printing the result of linear hypothesis tests, and invisibly returnsNULL
.The
logLik
method 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)