Learn R Programming

reghelper (version 1.1.2)

summary.block_lm: Summary functions for build_model block regression models.

Description

These functions offer useful methods for objects created by the build_model function: block_lm, block_aov, and block_glm.

Usage

# S3 method for block_lm
summary(object, ...)

# S3 method for block_lm_summary print( x, digits = max(3L, getOption("digits") - 3L), signif.stars = getOption("show.signif.stars"), ... )

# S3 method for block_lm coef(object, num = NULL, ...)

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

# S3 method for block_lm fitted(object, num = NULL, ...)

# S3 method for block_aov summary(object, ...)

# S3 method for block_aov_summary print( x, digits = max(3L, getOption("digits") - 3L), signif.stars = getOption("show.signif.stars"), ... )

# S3 method for block_aov coef(object, num = NULL, ...)

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

# S3 method for block_aov fitted(object, num = NULL, ...)

# S3 method for block_glm summary(object, ...)

# S3 method for block_glm_summary print( x, digits = max(3L, getOption("digits") - 3L), signif.stars = getOption("show.signif.stars"), ... )

# S3 method for block_glm coef(object, num = NULL, ...)

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

# S3 method for block_glm fitted(object, num = NULL, ...)

Value

The summary function computes and returns a named list of summary statistics of the fitted linear models given in object. The list has the following elements:

formulasA list of the regression formulas used for each block.
residualsA matrix with quantiles of the residuals for each model.
coefficientsA list with a matrix of coefficients for each model, as well as the standard error, t-statistic, and p-value.
overallA data frame with information about the overall models, including the multiple R-squared value; adjusted R-squared; F-statistic, degrees of freedom, and p-value for each overall model; and the delta R-squared (change in R-squared) and its associated F-statistic and p-value.

The other functions listed here provide convenient access to the individual components of this summary.

Arguments

object

An object of class block_lm, block_aov, or block_glm, usually, a result of a call to build_model.

...

Further arguments passed to or from other methods.

x

An object of class block_lm_summary, block_aov_summary, or block_glm_summary, usually, a result of a call to the corresponding summary function (e.g., summary.block_lm).

digits

The number of significant digits to use when printing.

signif.stars

Logical. If TRUE, 'significance stars' are printed for each coefficient.

num

Numeric vector with the index of model(s) from which to return the requested output. If NULL, will return output from all blocks.

Examples

Run this code
# 2 blocks: Petal.Length; Petal.Length + Petal.Width
model1 <- build_model(Sepal.Length, Petal.Length, Petal.Width, data=iris, model='lm')
summary(model1)
coef(model1)  # returns coefficients from 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')
summary(model2)
coef(model2, num=2)  # returns coefficients from second block only

Run the code above in your browser using DataLab