Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predict.hxlr

Predict/Fitted Values for HXLR Fits


Description

Obtains various types of predictions/fitted values for heteroscedastic extended logistic regression (HXLR) models.

Usage

## S3 method for class 'hxlr'
predict(object, newdata = NULL, type = c("class", "probability",
  "cumprob", "location", "scale"), thresholds = object$thresholds,
  na.action = na.pass, ...)
## S3 method for class 'hxlr'
fitted(object, type = c("class", "probability", 
  "cumprob", "location", "scale"), ...)

Arguments

object

an object of class "hxlr".

newdata

an optional data frame in which to look for variables with which to predict.

type

type of prediction: "probability" returns a data frame with category probabilities, "cumprob" returns cumulative probabilities, "location" and "scale" return the location and scale of the predicted latent distribution respectively, and "class" returns the category with the highest probability. Default is "class".

thresholds

optional thresholds used for defining the thresholds for types "probability", "cumprob", and "class". Can differ from thresholds used for fitting. If omitted, the same thresholds as for fitting are used.

na.action

A function which indicates what should happen when the data contain NAs. Default is na.pass

...

further arguments passed to or from other methods.

Value

For type "prob" a matrix with number of intervals (= number of thresholds + 1) columns is produced. Each row corresponds to a row in newdata and contains the predicted probabilities to fall in the corresponding interval.

For type "cumprob" a matrix with number of thresholds columns is produced. Each row corresponds to a row in newdata and contains the predicted probabilities to fall below the corresponding threshold.

For types "class", "location", and "scale" a vector is returned respectively with either the most probable categories ("class") or the location ("location") or scale (scale) of the latent distribution.

See Also


crch

Censored Regression with Conditional Heteroscedasticity

v1.0-4
GPL-2 | GPL-3
Authors
Jakob Messner [aut, cre] (<https://orcid.org/0000-0002-1027-3673>), Achim Zeileis [aut] (<https://orcid.org/0000-0003-0918-3766>), Reto Stauffer [aut] (<https://orcid.org/0000-0002-3798-5507>)
Initial release
2019-08-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.