sca_lm: Specification curve analysis (SCA) for linear regression

View source: R/sca_lm.R

sca_lmR Documentation

Specification curve analysis (SCA) for linear regression

Description

sca_lm is used to run specification curve analysis using linear regression. Fits every possible model for your specified dependent variable, predictor variables, and covariates

Usage

sca_lm(data, dv, ivs, covariates = NULL)

Arguments

data

dataframe

dv

dependent variable (outcome variable) (character)

ivs

independent variable(s) or predictor(s) (character)

covariates

covariates (character)

Details

Details to follow

Value

A tibble/data.table with results

Author(s)

Hause Lin

References

References to follow

Examples

# model with 1 covariate
m1 <- sca_lm(data = mtcars, dv = "mpg", ivs = c("cyl", "carb"), covariates = c("vs"))
m1[, c("modelformula", "term", "estimate", "p.value")] # model, term, beta, p value

# model without covariates
m2 <- sca_lm(data = mtcars, dv = "mpg", ivs = c("cyl", "gear"))
m2[, c("modelformula", "term", "estimate", "es.r")] # es.r is effect size

hauselin/hausekeep documentation built on Feb. 3, 2023, 3:09 p.m.