Learn R Programming

plgraphics (version 1.2)

predict.regrpolr: Predict and Fitted for polr Models

Description

Methods of predict and fitted

Usage

# S3 method for regrpolr
predict(object, newdata = NULL,
  type =  c("class", "probs", "link"), ...)
# S3 method for regrpolr
fitted(object, type = c("class", "probs", "link"), ...)

Value

Vector of predicted or linear predictor values

Arguments

object

result of polr

newdata

data frame in which to look for variables with which to predict. If NULL, fitted values are produced.

type

type of prediction:
"link" asks for the linear predictor values.
Other types are available according to the standard methods of the predict function.

...

arguments passed to standard methods of predict or fitted

Author

Werner A. Stahel, ETH Zurich

See Also

predict, fitted, residuals.regrpolr

Examples

Run this code
if(requireNamespace("MASS")) {
data(housing, package="MASS")
rr <- MASS::polr(Sat ~ Infl + Type + Cont, weights = Freq, data = housing)
aa <- fitted(rr)
bb <- predict(rr)
cc <- predict.regrpolr(rr)
}

Run the code above in your browser using DataLab