calc_r_squared | R Documentation |
This helper function computes the R-squared value for a given formula and dataset.
calc_r_squared(form, data)
form |
A formula specifying the regression model (e.g., |
data |
A data frame containing the variables used in the formula. |
The R-squared value from the linear model.
data <- mtcars
form <- "mpg ~ disp + hp + wt"
calc_r_squared(form, data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.