Learn R Programming

sn (version 2.1.1)

predict.selm: Predict method for selm-class objects

Description

Predicted values based on a model object produced by selm with univariate response.

Usage

# S3 method for selm
predict(object, newdata, param.type = "CP",
           interval = "none", level = 0.95, na.action = na.pass, ...)

Value

a vector of predictions (if interval="none") or a matrix of predictions and bounds with column names fit, lwr, and

upr, if interval is set.

Arguments

object

an object of class selm as produced by a call to function selm with univariate response.

newdata

an optional data frame in which to look for variables with which to predict. If omitted, the fitted values are used.

param.type

a character string with the required parameterization; it must be one of "CP", "DP", "pseudo-CP", or possibly their equivalent lowercase.

interval

type of interval calculation among "none", "confidence", "prediction"; it can be abbreviated.

level

tolerance/confidence level (default value is 0.95).

na.action

function determining what should be done with missing values in newdata. The default is to predict NA.

...

not used, only there for compatibility reasons.

Author

Adelchi Azzalini

Details

Predicted values are obtained by evaluating the regression function in the dataframe newdata (which defaults to model.frame(object)). Setting interval other than "none" produces computation of confidence or prediction (tolerance) intervals at the specified level.

If newdata is omitted the predictions are based on the data used for the fit.

The action taken in case of missing data is regulated by argument na.action, along the lines of function predict.lm.

A detailed description of the methodology underlying predict.selm is available in the technical note of Azzalini (2016).

References

Azzalini, A. (2016). Derivation of various types of intervals from a selm object. Technical note distributed with the documentation of the R package sn, in file selm-intervals.pdf within section ‘User guide, package vignettes and other documentation’.

See Also

selm, summary.selm,

makeSECdistr for the CP/DP parameterizations,

predict.lm for usage of na.action

Examples

Run this code
data(barolo)
attach(barolo)  
A75 <- (reseller=="A" & volume==75)
detach(barolo)
m3 <- selm(log(price, 10) ~ age, data=barolo[A75,], family="ST")                

Run the code above in your browser using DataLab