Learn R Programming

climatehealth (version 1.0.0)

check_and_write_vif: Check multicollinearity using VIF and write the results to file

Description

This function runs check_diseases_vif(), reshapes the result into a tabular data frame, and optionally writes the table to VIF_results.csv.

Usage

check_and_write_vif(data, param_term, inla_param, case_type, output_dir = NULL)

Value

A data frame with columns variable, VIF, and interpretation.

Arguments

data

A data frame containing the disease outcome column, param_term, and the variables listed in inla_param.

param_term

Character vector of exposure variable term(s) to include in the VIF assessment.

inla_param

Character vector of additional model covariates to include in the VIF assessment.

case_type

Character. The type of disease that the case column refers to. Must be one of "diarrhea" or "malaria".

output_dir

Character. The output directory to save the VIF results to. Results are saved as VIF_results.csv. Defaults to NULL.