nestedHypotheses | R Documentation |
"nestedLogit"
ObjectsVarious methods for testing hypotheses about nested logit models.
Anova
Calculates type-II or type-III analysis-of-variance tables for "nestedLogit"
objects;
see Anova
in the car package.
anova
Computes sequential analysis of variance (or deviance) tables for one or more fitted
"nestedLogit"
objects; see anova
.
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
and BIC
model-comparison statistics).
## 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 to be passed down. In the case of |
x, object, object2, mod, model |
in most cases, an object of class |
The Anova
and anova
methods return objects
of class "Anova.nestedLogit"
and "anova.nestedLogit"
, respectively,
each of which contains a list of "anova"
objects (see anova
)
and is usually printed.
The linearHypothesis
method is called for its side effect, printing
the result of linear hypothesis tests, and invisibly returns NULL
.
The logLik
method returns an object of class "logLik"
(see logLik
).
John Fox
Anova
, anova
,
linearHypothesis
, logLik
, AIC
,
BIC
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.