residuals.regrpolr | R Documentation |
Methods of residuals
for classes
polr, survreg
and coxph
,
calculating quartiles and random numbers according to the
conditional distribution of residuals for the latent variable of a
binary or ordinal regression or a regression with censored response,
given the observed response value.
See Details for an explanation.
## S3 method for class 'polr'
residuals(object, type="condquant", ...)
## S3 method for class 'regrpolr'
residuals(object, type="condquant", ...)
## S3 method for class 'regrsurvreg'
residuals(object, type="condquant", ...)
## S3 method for class 'regrcoxph'
residuals(object, type="CoxSnellMod", ...)
object |
the result of |
type |
type of residuals:
|
... |
arguments passed to standard methods of |
For binary and ordinal regression, the regression models can be described by introducing a latent response variable Z of which the observed response Y is a classified version, and for which a linear regression applies. The errors of this "latent regression" have a logistic distribution. Given the linearly predicted value eta[i], which is the fitted value for the latent variable, the residual for Z[i] can therefore be assumed to have a logistic distribution.
This function calculates quantiles and random numbers according to the conditional distribution of residuals for Z[i], given the observed y[i].
Modified Cox-Snell residuals: Cox-Snell residuals are defined in a way that they always follow an exponential distribution. Since this is an unususal law for residuals, it is convenient to transform them such that they then obey a standard normal distribution. See the vignette for more detail.
Vector of residual values. If conditional quantiles are requested,
the residuals for censored observations are replaced by conditional
medians, and an attribute "condquant"
is attached, which is
a data.frame with the variables
median |
median of the conditional distributions |
lowq |
lower quartile |
uppq |
upper quartile |
random |
random number, drawn according to the conditional distribution |
prob |
probability of the condition being true |
limlow, limup |
lower and upper limits of the intervals |
index |
index of the observation in the sequence of the result (residuals) |
fit |
linear predictor value |
y |
observed response value |
residuals.polr
and residuals.regrpolr
are identical
for the time being. Only type="condquant"
is available now.
Werner A. Stahel, ETH Zurich
See http://stat.ethz.ch/~stahel/regression
condquant
, plregr
require(MASS)
data(housing, package="MASS")
rr <- polr(Sat ~ Infl + Type + Cont, weights = Freq, data = housing)
t.res <- residuals.regrpolr(rr)
head (t.res)
summary(t.res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.