fitted.regr: Fitted Values for regr and polr objects

Description Usage Arguments Value Author(s) Examples

Description

fitted.regr extracts fitted values from regr objects. The function is needed for results of survival models, including Tobit models. fitted.polr calculates Fitted Values for ordered response regression. In addition to the types of the usual version, this function allows for extracting the link type of predictions.

Usage

1
2
3
4
## S3 method for class 'regr'
fitted(object, type = NULL, ...)
## S3 method for class 'polr'
fitted(object, type = "link", na.action = object, ...)

Arguments

object

an object of class regr (for fitted.regr), or one that inherits from class polr (for fitted.polr)

type

type of fitted values (as with predict).

link

asks for the linear predictor,

class

returns the most likely (integer) Y values

probs

returns probabilities for each value of Y

na.action

object that possibly contains an na.action component. If it is of the class exclude, the fitted values will be expanded to fit the number of rows in the data.frame used for fitting the regression.

...

further arguments, passed to fitted methods called by fitted.regr; not used in fitted.polr

Value

Vector (or matrix) of fitted values

Author(s)

Werner A. Stahel, Seminar for Statistics, ETH Zurich

Examples

1
2
3
4
5
data(housing, package="MASS") 
house.plr <- MASS::polr(Sat ~ Infl + Type + Cont, weights = Freq,
  data = housing)
house.fit <- fitted(house.plr, type="link") # only possible with regr version
summary( house.fit )

regr0 documentation built on May 2, 2019, 4:52 p.m.

Related to fitted.regr in regr0...