Learn R Programming

climatehealth (version 1.0.0)

check_wildfire_vif: Check variance inflation factors of predictor variables using a linear model

Description

Checks variance inflation factors of predictor variables using a linear model of the predictor variables on the health outcome. Prints stats if print_vif==TRUE. Raises a warning if VIF for a variables is > 2.

Usage

check_wildfire_vif(
  data,
  predictors,
  save_csv = FALSE,
  output_folder_path = NULL,
  print_vif = FALSE
)

Value

Variance inflation factor statistics for each predictor variable.

Arguments

data

Dataframe containing a daily time series of climate and health data.

predictors

Character vector with each of the predictors to include in the model. Must contain at least 2 variables.

save_csv

Bool. Whether or not to save the VIF results to a CSV.

output_folder_path

String. Where to save the CSV file to (if save_csv == TRUE).

print_vif

Bool, whether or not to print VIF for each predictor. Defaults to FALSE.