% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nestedMethods.R
\name{nestedMethods}
\alias{nestedMethods}
\alias{print.nestedLogit}
\alias{summary.nestedLogit}
\alias{print.summary.nestedLogit}
\alias{update.nestedLogit}
\alias{coef.nestedLogit}
\alias{vcov.nestedLogit}
\alias{print.dichotomies}
\alias{as.dichotomies.matrix}
\alias{as.matrix.continuationDichotomies}
\alias{as.character.dichotomies}
\alias{as.matrix.dichotomies}
\alias{as.dichotomies}
\title{Methods for \code{"nestedLogit"} and Related Objects}
\usage{
\method{print}{nestedLogit}(x, ...)

\method{summary}{nestedLogit}(object, ...)

\method{print}{summary.nestedLogit}(x, ...)

\method{print}{dichotomies}(x, ...)

\method{coef}{nestedLogit}(object, as.matrix = TRUE, ...)

\method{vcov}{nestedLogit}(object, as.matrix = FALSE, ...)

\method{update}{nestedLogit}(object, formula, dichotomies, data, subset, contrasts, ...)

\method{as.matrix}{dichotomies}(x, ...)

\method{as.character}{dichotomies}(x, ...)

\method{as.matrix}{continuationDichotomies}(x, ...)

as.dichotomies(x, ...)

\method{as.dichotomies}{matrix}(x, ...)
}
\arguments{
\item{x, object}{in most cases, an object of class \code{"nestedLogit"}.}

\item{\dots}{arguments to be passed down.}

\item{as.matrix}{if \code{TRUE} (the default for \code{coef}) return coefficients
as a matrix with one column for each nested dichotomy,
or coefficient covariances as a matrix with one row and column for each
combination of dichotomies and coefficients; if \code{FALSE} (the default for
\code{vcov}), return a list of coefficients or coefficient covariances
with one element for each dichotomy.}

\item{formula}{optional updated model formula.}

\item{dichotomies}{optional updated dichotomies object.}

\item{data}{optional updated data argument}

\item{subset}{optional updated subset argument.}

\item{contrasts}{optional updated contrasts argument.}
}
\value{
\itemize{
\item The \code{coef} and \code{vcov} methods return either matrices or lists of regression
coefficients and their covariances, respectively.
\item The \code{update} method returns an object of class \code{"nestedLogit"} (see \code{\link{nestedLogit}})
derived from the original nested-logit model.
\item The \code{summary} method returns an object of class \code{"summary.nestedLogit"}, which is
a list of summaries of the \code{\link{glm}} objects that comprise the nested-dichotomies model; the
object is normally printed.
\item The methods for \code{as.matrix}, \code{as.character}, and \code{as.dichotomies} coerce
various objects to matrices, character vectors, and dichotomies objects.
\item The various \code{print} methods invisibly return their \code{x} arguments.
}
}
\description{
Various methods for processing \code{"nestedLogit"} and related objects.
Most of these are the standard methods for a model-fitting function.
\describe{
\item{\code{coef}, \code{vcov}}{Return the coefficients and their variance-covariance matrix respectively.}
\item{\code{update}}{Re-fit a \code{"nestedLogit"} model with a change in any of the \code{formula}, \code{dichotomies},
\code{data}, \code{subset}, or \code{contrasts}, arguments.}
\item{\code{summary}}{Summarize a \code{"nestedLogit"} model, giving the summary for each binary logit model in the
nested dichotomies.}
\item{\code{print}}{Print the model or a summary of the model.}
\item{\code{as.matrix}, \code{as.character}, \code{as.dichotomies}}{Coerce
dichotomy-related objects to matrices, character vectors, and dichotomies objects.}
}
}
\examples{
# define continuation dichotomies for level of education
cont.dichots <- continuationLogits(c("<highschool",
                                     "highschool",
                                     "college",
                                     "graduate"))

# Show dichotomies in various forms
print(cont.dichots)
as.matrix(cont.dichots)
as.character(cont.dichots)

# 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)

coef(m)                             # coefficient estimates
sqrt(diag(vcov(m, as.matrix=TRUE))) # standard errors
print(m)
summary(m)

}
\seealso{
\code{\link{nestedLogit}}, \code{\link{predict.nestedLogit}},
\code{\link{plot.nestedLogit}},
\code{\link{glance.nestedLogit}}, \code{\link{tidy.nestedLogit}}
}
\author{
John Fox and Michael Friendly
}
\keyword{regression}
