Skip to contents

Based on the filter_na argument, data is filtered for modelling based on NA values within df.

Usage

filter_model_data(df, formula_vars, filter_na)

Arguments

df

Data frame of model data.

formula_vars

Character vector of variables used in the model. Can be extracted from a formula using all.vars(fmla).

filter_na

Character value specifying how, if at all, to filter NA values from the dataset prior to applying the model. By default, all observations with missing values are removed, although it can also remove rows only if they have missing dependent or independent variables, or no filtering at all.

Value

A data frame.