Skip to contents

Performs Akaike information criterion (AIC) informed variable selection using the stats::step function.

Usage

AIC_stepwise_regression(outcome, dataset, variables, stepwise_direction)

Arguments

outcome

Outcome of interest. Character string.

dataset

Dataframe that contains the trait and exposure variables

variables

Exposure variables of interest. Must be numeric or one-hot encoded.

stepwise_direction

Direction of stepwise selection. Options include: 'both', 'backward', or 'forward'. For more information on these selection methods, see stats::step.

Value

Regression results