Learn R Programming

DHARMa (version 0.5.1)

getPearsonResiduals: Get Pearson residuals

Description

Wrapper to get the Pearson residuals of a fitted model.

Usage

getPearsonResiduals(object, ...)

# S3 method for default getPearsonResiduals(object, ...)

# S3 method for gam getPearsonResiduals(object, ...)

# S3 method for brmsfit getPearsonResiduals(object, ...)

Arguments

object

a fitted model.

...

additional parameters to be passed on, usually to the residual function of the respective model class.

Author

Florian Hartig

Details

The purpose of this wrapper is to extract the Pearson residuals of a fitted model.

See Also

getObservedResponse, getSimulations, getRefit, getFixedEffects, getFitted

Examples

Run this code
testData = createData(sampleSize = 400, family = gaussian())

fittedModel <- lm(observedResponse ~ Environment1 , data = testData)

# response that was used to fit the model
getObservedResponse(fittedModel)

# predictions of the model for these points
getFitted(fittedModel)

# predictions on the scale of the observed response
# (differs from getFitted only for k/n binomial models)
getFittedResponse(fittedModel)

# extract simulations from the model as matrix
getSimulations(fittedModel, nsim = 2)

# extract simulations from the model for refit (often requires different structure)
x = getSimulations(fittedModel, nsim = 2, type = "refit")

getRefit(fittedModel, x[[1]])

getRefit(fittedModel, getObservedResponse(fittedModel))

# get data frame that was used to fit the model
getData(fittedModel)

Run the code above in your browser using DataLab