Learn R Programming

refund (version 0.1-40)

residuals.pffr: Obtain residuals and fitted values for a pffr models

Description

See predict.pffr for alternative options to extract estimated values from a pffr object. "Fitted values" here refers to the estimated additive predictor values, these will not be on the scale of the response for models with link functions.

Usage

# S3 method for pffr
residuals(object, reformat = TRUE, ...)

# S3 method for pffr fitted(object, reformat = TRUE, which = c("mean", "scale", "both"), ...)

Value

A matrix or ydata-like data.frame or a vector of residuals / fitted values (see reformat-argument). For

fitted.pffr with family = "gaulss" and which = "both", returns a list with mean and scale components.

Arguments

object

a fitted pffr-object

reformat

logical, defaults to TRUE. Should residuals/fitted values be returned in n x yindex matrix form (regular grid data) or, respectively, in the shape of the originally supplied ydata argument (sparse/irregular data), or, if FALSE, simply as a long vector as returned by resid.gam() or fitted.gam()?

...

other arguments, passed to residuals.gam.

which

For fitted.pffr with family = "gaulss" only: which fitted values to return. One of "mean" (default, returns predicted means), "scale" (returns predicted log-standard deviations), or "both" (returns list with both components).

Author

Fabian Scheipl

Details

For family = "gaulss" (Gaussian location-scale models), the fitted values matrix has two columns: means and log-standard deviations. Use the which argument in fitted.pffr to control which values are returned.