get_matrix_r2: Calculate (adjusted) r-squared for a matrix

View source: R/model_selection.R

get_matrix_r2R Documentation

Calculate (adjusted) r-squared for a matrix

Description

Calculates regression model r-squared across a matrix of outcomes.

Usage

get_matrix_r2(outcomes, residuals, adjusted = F, dof = NULL)

Arguments

outcomes

A data frame like object with outcome variables as rows and observations as columns.

residuals

A numeric matrix with each column representing the residuals for an outcome. The ordering follows the row order of outcomes.

adjusted

A boolean indicating if the adjusted r-squared should be calculated in addition to the unadjusted r-squared.

dof

An integer denoting the degrees of freedom of the regression model used to compute the residuals. Only required if computing adjusted r-squared.

Value

A list with the following items:

  • r2: A numeric value corresponding to the unadjusted r-squared.

  • adjusted_r2: A numeric value (or NA) corresponding to the adjusted r-squared.

See Also

get_residual_matrix


bryancquach/omixjutsu documentation built on Jan. 29, 2023, 3:47 p.m.