\Header{polr}{Proportional Odds Logistic Regression}
\keyword{models}{polr}
\begin{Description}\relax
Fits a proportional odd logistic regression model to an ordered factor
response.
\end{Description}
\begin{Usage}
\begin{verbatim}
polr(formula, data, weights, start, ..., subset, na.action,
     contrasts = NULL, Hess = FALSE, model = TRUE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{formula}] a formula expression as for regression models, of the form
\code{response \textasciitilde{} predictors}. The response should be a factor
(preferably an ordered
factor), which will be interpreted as an ordinal response, with levels
ordered as in the factor.  A proportional odds model will be
fitted. The model must have an intercept: attempts to remove one will
lead to a warning and be ignored. An offset may be used. See the
documentation of \code{formula} for other details.

\item[\code{data}] an optional data frame in which to interpret the variables occurring
in \code{formula}.

\item[\code{weights}] optional case weights in fitting.  Default to 1.

\item[\code{start}] initial values for the parameters.

\item[\code{...}] additional arguments to be passed to \code{\Link{optim}}, most often a
\code{control} argument.

\item[\code{subset}] expression saying which subset of the rows of the data should  be used
in the fit. All observations are included by default.

\item[\code{na.action}] a function to filter missing data.

\item[\code{contrasts}] a list of contrasts to be used for some or all of
the factors appearing as variables in the model formula.

\item[\code{Hess}] logical for whether the Hessian (the observed information matrix)
should be returned.

\item[\code{model}] logical for whether the model matrix should be returned.

\end{ldescription}
\end{Arguments}
\begin{Value}
A object of class \code{"polr"}.

\begin{ldescription}
\item[\code{coefficients}] the coefficients of the linear predictor.

\item[\code{zeta}] the intercepts for the class boundaries.

\item[\code{deviance}] the residual deviance.

\item[\code{fitted.values}] a matrix, with a column for each level of the response.

\item[\code{lev}] the names of the response levels.

\item[\code{terms}] the \code{terms} structure describing the model.

\item[\code{df.residual}] the number of residual degrees of freedoms, calculated using the weights.

\item[\code{edf}] the (effective) number of degrees of freedom used by the model

\item[\code{n}] the (effective) number of observations,  calculated using the weights

\item[\code{call}] the matched call.

\item[\code{convergence}] the convergence code returned by \code{optim}.

\item[\code{niter}] the number of function and gradient evaluations used by \code{optim}.

\item[\code{Hessian}] (if \code{Hess} is true).

\item[\code{model}] (if \code{model} is true).

\end{ldescription}
\end{Value}
\begin{References}\relax
Venables, W. N. and Ripley, B. D. (2002)
\emph{Modern Applied Statistics with S.} Fourth edition.  Springer.
\end{References}
\begin{SeeAlso}\relax
\code{\Link{optim}}, \code{\Link{glm}}, \code{\Link{multinom}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
options(contrasts = c("contr.treatment", "contr.poly"))
house.plr <- polr(Sat ~ Infl + Type + Cont, weights = Freq, data = housing)
house.plr
summary(house.plr)
predict(house.plr, housing, type = "p")
addterm(house.plr, ~.^2, test = "Chisq")
house.plr2 <- stepAIC(house.plr, ~.^2)
house.plr2$anova
\end{ExampleCode}
\end{Examples}

