tidy_lm: tidy_lm

Description Usage Arguments Value

View source: R/tidy_lm.R

Description

A function to streamline the process of running regressions in experimental psychology

Usage

1
2
3
tidy_lm(data, dv, terms, style = "default", treatment = NULL,
  clusters = NULL, robust_se = FALSE, alpha = 0.05,
  print_summary = FALSE)

Arguments

data

A data.frame

dv

Vector of one or more dependent variables. The function will regress all the terms on each dv separately

terms

Vector of terms to regress on dv.

style

Character string either "default", "incremental", "chord", or "bivariate". In what way should the terms regress on dv.

  • "default" uses all terms at once on all the DVs.

  • "incremental" starts off with one term and adds one more term each model for each dv.

  • "chord" begins by running a bivariate regression the first term. Then runs a trivariate regression, holding the dv, first is term constant looping through the remaining terms. Lastly, all terms are ran together.

  • "bivariate" uses all terms individually on each dv.

treatment

Vector for terms to include in the output dataset. Returns coefficent, lower confidence interval, upper confidence interval, standard error, t-value, and p-value.

clusters

Clusters for grouping standard error.

robust_se

TRUE/FALSE. Whether to use to use robust standard errors ("HC2"). Equivalent to default standard error from lm_robust(). Set to FALSE by default.

alpha

Numeric p-value for the standard errors. Default .05.

print_summary

TRUE/FALSE. Whether to print model summaries or not. Default is FALSE.

Value

A tibble containing all linear models, and data on what variables are included in each model.


johnhenrypezzuto/blpl documentation built on Dec. 6, 2019, 2:36 a.m.