regression_lin: regression_lin

View source: R/regression_lin.R

regression_linR Documentation

regression_lin

Description

Calculates linear regression models using lm(). Designed to make analysis with multiple predictors / outcomes easy and quick.

Usage

regression_lin(
  .data,
  .outcomes = NULL,
  .predictors = NULL,
  .covariates = NULL,
  .annotation = NULL,
  .subset = NULL,
  .cpus = 1,
  .sort_by = "outcomes",
  .std_prd = FALSE,
  .std_cov = NULL,
  .summary = FALSE,
  .interaction = NULL,
  .imputed_predictors = FALSE,
  .imputed_outcomes = FALSE,
  ...
)

Arguments

.data

A data.frame or .mids object.

.outcomes

A character vector containing the outcomes.

.predictors

A character vector containing the predictors.

.covariates

A character vector containing covariates.

.annotation

A matrix or data.frame of format (name, pname, unit, short_pname, comment) that contains pretty names for the used variables.

.subset

Can be used to internally subset the data. Use .subset = "variable == 'x'" to subset data.

.cpus

Input number of desired cpus to use. Useful only in case of big datasets and multiple outcomes/predictors.

.sort_by

A character string that indicates either to sort the analyses by "outcomes" or by "predictors".

.std_prd

If TRUE, predictors are standardized.

.std_cov

Character vector of covariates that should be standardized.

.summary

If TRUE, an additional summary of all analyses is returned.

.interaction

Can be used to specify interactions using a list of character vectors containing the interaction variables, e.g. list(c("variable1", "variable2"), c("variable2", "variable3")).

.imputed_predictors

If TRUE, cases with imputed predictors are used.

.imputed_outcomes

If TRUE, cases with imputed outcomes are used.

...

Optional input passed directly to the regression function.

Value

A list containing individual results tables for each regression analysis.

Examples

-

janbrederecke/analyzeD documentation built on Jan. 2, 2023, 5:41 a.m.