calc_r_squared: Calculate R-Squared Value

calc_r_squaredR Documentation

Calculate R-Squared Value

Description

This helper function computes the R-squared value for a given formula and dataset.

Usage

calc_r_squared(form, data)

Arguments

form

A formula specifying the regression model (e.g., "y ~ x1 + x2").

data

A data frame containing the variables used in the formula.

Value

The R-squared value from the linear model.

Examples

data <- mtcars
form <- "mpg ~ disp + hp + wt"
calc_r_squared(form, data)


emilelatour/lamisc documentation built on March 29, 2025, 1:23 p.m.