Learn R Programming

reghelper (version 0.3.3)

residuals.block_glm_summary: Extract model residuals.

Description

residuals method for class "block_glm_summary".

Usage

# S3 method for block_glm_summary
residuals(object, num = NULL, ...)

Arguments

object

An object of class "block_glm_summary", usually, a result of a call to summary.block_glm.

num

Numeric vector with the index of model(s) from which to return the residuals.

...

Further arguments passed to or from other methods.

Value

The residuals of block(s) `num`, or if `num` is NULL, a list of residuals from all blocks.

See Also

summary.block_lm, residuals.block_lm, coef.block_lm_summary

Examples

Run this code
# NOT RUN {
# 2 blocks: Petal.Length; Petal.Length + Petal.Width
model1 <- build_model(Sepal.Length, Petal.Length, Petal.Width, data=iris, model='lm')
residuals(summary(model1))  # returns both blocks 1 and 2

# 2 blocks: Species; Species + Petal.Length + Petal.Width + Petal.Length:Petal.Width
model2 <- build_model(Sepal.Length, Species, c(Petal.Length * Petal.Width), data=iris, model='lm')
residuals(summary(model2), num=2)  # returns second block
# }

Run the code above in your browser using DataLab