missingness_patterns: missingness patterns

Description Usage Arguments Examples

View source: R/data_wrangling.R

Description

this function shows how common possible missingness patterns are. Emulates misschk in stata.

  1. excludes any variables that don't have any missings, so as not to clutter output. Disable using omit_complete

  2. sorts variables by number of missings, so that the usual suspects show up at the front.

  3. displays number of missings accounted for by each pattern

Usage

1
2
3
missingness_patterns(df, min_freq = ifelse(relative, 1/nrow(df), 1),
  long_pattern = FALSE, print_legend = ifelse(long_pattern, FALSE, TRUE),
  show_culprit = TRUE, relative = FALSE, omit_complete = TRUE)

Arguments

df

dataset

min_freq

show only patterns that occur at least this often. Defaults to 1 observation.

long_pattern

by default (FALSE) only shows column indices for space and legibility reasons.

print_legend

prints a legend for the column indices, defaults to FALSE if long_pattern is set

show_culprit

defaults to TRUE. In case a missingness pattern boils down to one variable, it will be shown here.

relative

defaults to FALSE. If true, percentages are shown (relative to total before excluding minimum frequency).

omit_complete

defaults to TRUE. Columns that don't have any missings are excluded.

Examples

1
2
3
4
5

grebbel/formr_test documentation built on May 17, 2019, 8:34 a.m.