lm_error_var: Calculate error variance given model coefficients.

View source: R/helpers.R

lm_error_varR Documentation

Calculate error variance given model coefficients.

Description

lm_error_var will calculate the required error variance for a linear model, given specified model coefficients, to create variance for your dependent variable of approximately 'var'.

Usage

lm_error_var(var = 1, ...)

Arguments

var

The variance you wish your dependent variable to be.

...

Pass along all model coefficients, excluding the intercept. These can be named or unnamed.

Details

Note: This function assumes that all predictors are independent (i.e., uncorrelated).

Value

Returns the required error variance so that the variance of your dependent variable is approximately 'var'.

Examples

lm_error_var(var=1, .15, .3)  # returns error variance of 0.8875

paramtest documentation built on April 3, 2025, 7:14 p.m.