block_model_summ: Summary functions for build_model block regression models.

summary.block_lmR Documentation

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 class 'block_lm'
summary(object, ...)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

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:

formulas A list of the regression formulas used for each block.
residuals A matrix with quantiles of the residuals for each model.
coefficients A list with a matrix of coefficients for each model, as well as the standard error, t-statistic, and p-value.
overall A 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.

Examples

# 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

reghelper documentation built on Sept. 3, 2023, 1:07 a.m.