Learn R Programming

naniar (version 0.0.3.9901)

miss_cat: Create factor levels of missingness for two variables

Description

miss_cat takes a data frame, df , and two variables as strings, var1 and var2, and converts them to a missing TRUE/FALSE matrix, where TRUE = missing. It then uses interaction, to create all the different levels of missingness - TRUE.TRUE, TRUE.FALSE, FALSE.TRUE, and FALSE.FALSE. It then uses the function shadow_cat to collapse across these and put them into the relevant categories

Usage

miss_cat(df, var1, var2)

Arguments

df
a dataframe
var1
a dataframe
var2
a dataframe