📄 polr.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Ordered Logistic or Probit Regression</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../R.css">
</head><body>
<table width="100%" summary="page for polr {MASS}"><tr><td>polr {MASS}</td><td align="right">R Documentation</td></tr></table>
<h2>Ordered Logistic or Probit Regression</h2>
<h3>Description</h3>
<p>
Fits a logistic or probit regression model to an ordered factor
response. The default logistic case is <EM>proportional odds
logistic regression</EM>, after which the function is named.
</p>
<h3>Usage</h3>
<pre>
polr(formula, data, weights, start, ..., subset, na.action,
contrasts = NULL, Hess = FALSE, model = TRUE,
method = c("logistic", "probit", "cloglog", "cauchit"))
</pre>
<h3>Arguments</h3>
<table summary="R argblock">
<tr valign="top"><td><code>formula</code></td>
<td>
a formula expression as for regression models, of the form
<code>response ~ predictors</code>. 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.
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><a href="../../stats/html/formula.html">formula</a></code> for other details.
</td></tr>
<tr valign="top"><td><code>data</code></td>
<td>
an optional data frame in which to interpret the variables occurring
in <code>formula</code>.
</td></tr>
<tr valign="top"><td><code>weights</code></td>
<td>
optional case weights in fitting. Default to 1.
</td></tr>
<tr valign="top"><td><code>start</code></td>
<td>
initial values for the parameters. This is in the format
<code>c(coefficients, zeta)</code>: see the Values section.
</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>
additional arguments to be passed to <code><a href="../../stats/html/optim.html">optim</a></code>, most often a
<code>control</code> argument.
</td></tr>
<tr valign="top"><td><code>subset</code></td>
<td>
expression saying which subset of the rows of the data should be used
in the fit. All observations are included by default.
</td></tr>
<tr valign="top"><td><code>na.action</code></td>
<td>
a function to filter missing data.
</td></tr>
<tr valign="top"><td><code>contrasts</code></td>
<td>
a list of contrasts to be used for some or all of
the factors appearing as variables in the model formula.
</td></tr>
<tr valign="top"><td><code>Hess</code></td>
<td>
logical for whether the Hessian (the observed information matrix)
should be returned. Use this if you intend to call <code>summary</code> or
<code>vcov</code> on the fit.
</td></tr>
<tr valign="top"><td><code>model</code></td>
<td>
logical for whether the model matrix should be returned.
</td></tr>
<tr valign="top"><td><code>method</code></td>
<td>
logistic or probit or complementary log-log or cauchit (corresponding
to a Cauchy latent variable).
</td></tr>
</table>
<h3>Details</h3>
<p>
This model is what Agresti (2002) calls a <EM>cumulative link</EM>
model. The basic interpretation is as a <EM>coarsened</EM> version of a
latent variable <i>Y_i</i> which has a logistic or normal or
extreme-value or Cauchy distribution
with scale parameter one and a linear model for the mean. The ordered
factor which is observed is which bin <i>Y_i</i> falls into with
breakpoints
</p><p align="center"><i>zeta_0 = -Inf < zeta_1 < ... < zeta_K = Inf</i></p><p>
This leads to the model
</p><p align="center"><i>logit P(Y <= k | x) = zeta_k - eta</i></p><p>
with <EM>logit</EM> replaced by <EM>probit</EM> for a normal latent
variable, and <i>eta</i> being the linear predictor, a linear
function of the explanatory variables (with no intercept). Note
that it is quite common for other software to use the opposite sign
for <i>eta</i> (and hence the coefficients <code>beta</code>).
</p>
<p>
In the logistic case, the left-hand side of the last display is the
log odds of category <i>k</i> or less, and since these are log odds
which differ only by a constant for different <i>k</i>, the odds are
proportional. Hence the term <EM>proportional odds logistic
regression</EM>.
</p>
<p>
In the complementary log-log case, we have a <EM>proportional
hazards</EM> model for grouped survival times.
</p>
<p>
There are methods for the standard model-fitting functions, including
<code><a href="../../VGAM/html/notdocumentedyet.html">predict</a></code>, <code><a href="../../Zelig/html/summary.zelig.html">summary</a></code>, <code><a href="../../stats/html/vcov.html">vcov</a></code>,
<code><a href="../../stats/html/anova.html">anova</a></code>, <code><a href="../../stats/html/model.frame.html">model.frame</a></code> and an
<code>extractAIC</code> method for use with <code><a href="stepAIC.html">stepAIC</a></code>. There
are also <code><a href="../../stats/html/profile.html">profile</a></code> and <code><a href="../../tilingArray/html/class-segmentation.html">confint</a></code> methods.
</p>
<h3>Value</h3>
<p>
A object of class <code>"polr"</code>. This has components
</p>
<table summary="R argblock">
<tr valign="top"><td><code>coefficients</code></td>
<td>
the coefficients of the linear predictor, which has no
intercept.</td></tr>
<tr valign="top"><td><code>zeta</code></td>
<td>
the intercepts for the class boundaries.</td></tr>
<tr valign="top"><td><code>deviance</code></td>
<td>
the residual deviance.</td></tr>
<tr valign="top"><td><code>fitted.values</code></td>
<td>
a matrix, with a column for each level of the response.</td></tr>
<tr valign="top"><td><code>lev</code></td>
<td>
the names of the response levels.</td></tr>
<tr valign="top"><td><code>terms</code></td>
<td>
the <code>terms</code> structure describing the model.</td></tr>
<tr valign="top"><td><code>df.residual</code></td>
<td>
the number of residual degrees of freedoms,
calculated using the weights.</td></tr>
<tr valign="top"><td><code>edf</code></td>
<td>
the (effective) number of degrees of freedom used by the model</td></tr>
<tr valign="top"><td><code>n, nobs</code></td>
<td>
the (effective) number of observations, calculated using the
weights. (<code>nobs</code> is for use by <code><a href="stepAIC.html">stepAIC</a></code>.</td></tr>
<tr valign="top"><td><code>call</code></td>
<td>
the matched call.</td></tr>
<tr valign="top"><td><code>method</code></td>
<td>
the matched method used.</td></tr>
<tr valign="top"><td><code>convergence</code></td>
<td>
the convergence code returned by <code>optim</code>.</td></tr>
<tr valign="top"><td><code>niter</code></td>
<td>
the number of function and gradient evaluations used by
<code>optim</code>.</td></tr>
<tr valign="top"><td><code>Hessian</code></td>
<td>
(if <code>Hess</code> is true).</td></tr>
<tr valign="top"><td><code>model</code></td>
<td>
(if <code>model</code> is true).</td></tr>
</table>
<h3>References</h3>
<p>
Agresti, A. (2002) <EM>Categorical Data.</EM> Second edition. Wiley.
</p>
<p>
Venables, W. N. and Ripley, B. D. (2002)
<EM>Modern Applied Statistics with S.</EM> Fourth edition. Springer.
</p>
<h3>See Also</h3>
<p>
<code><a href="../../stats/html/optim.html">optim</a></code>, <code><a href="../../VGAM/html/notdocumentedyet.html">glm</a></code>, <code><a href="../../nnet/html/multinom.html">multinom</a></code>.
</p>
<h3>Examples</h3>
<pre>
options(contrasts = c("contr.treatment", "contr.poly"))
house.plr <- polr(Sat ~ Infl + Type + Cont, weights = Freq, data = housing)
house.plr
summary(house.plr)
## slightly worse fit from
summary(update(house.plr, method = "probit"))
## although it is not really appropriate, can fit
summary(update(house.plr, method = "cloglog"))
predict(house.plr, housing, type = "p")
addterm(house.plr, ~.^2, test = "Chisq")
house.plr2 <- stepAIC(house.plr, ~.^2)
house.plr2$anova
anova(house.plr, house.plr2)
house.plr <- update(house.plr, Hess=TRUE)
pr <- profile(house.plr)
confint(pr)
plot(pr)
pairs(pr)
</pre>
<hr><div align="center">[Package <em>MASS</em> version 7.2-44 <a href="00Index.html">Index]</a></div>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -