beta_stats: Beta Statistics for Linear Model

View source: R/con_stats.R

beta_statsR Documentation

Beta Statistics for Linear Model

Description

This function calculates beta statistics for a linear model fit.

Usage

beta_stats(lmfit, varnames, se = TRUE)

Arguments

lmfit

Fitted linear model object.

varnames

Vector of variable names.

se

Logical flag indicating whether to calculate standard errors (default: TRUE).

Value

A list containing the following elements:

  • estimate: Estimated beta coefficients.

  • stat: t-statistics of the beta coefficients (if se = TRUE).

  • se: Standard errors of the beta coefficients (if se = TRUE).

  • prob: Probabilities associated with the t-statistics (if se = TRUE).

  • stat_type: Type of the statistics calculated.

Examples

data(mtcars)
lm_fit <- lm(mpg ~ wt + qsec + am, data = mtcars)
beta_stats(lm_fit, c("Intercept", "wt", "qsec", "am"))

bbuchsbaum/fmrireg documentation built on May 16, 2023, 10:56 a.m.