missing_compare: Compare missing data

View source: R/missing_compare.R

missing_compareR Documentation

Compare missing data

Description

Compare missing data

Usage

missing_compare(
  .data,
  dependent,
  explanatory,
  p = TRUE,
  na_include = FALSE,
  ...
)

Arguments

.data

Dataframe.

dependent

Variable to test missingness against other variables with.

explanatory

Variables to have missingness tested against.

p

Logical: Include null hypothesis statistical test.

na_include

Include missing data in explanatory variables as a factor level.

...

Other arguments to summary_factorlist().

Value

A dataframe comparing missing data in the dependent variable across explanatory variables. Continuous data are compared with an Analysis of Variance F-test by default. Discrete data are compared with a chi-squared test.

Examples

library(finalfit)

explanatory = c("age", "age.factor", "extent.factor", "perfor.factor")
dependent = "mort_5yr"

colon_s %>%
  ff_glimpse(dependent, explanatory)

colon_s %>%
 missing_pattern(dependent, explanatory)

colon_s %>%
  missing_compare(dependent, explanatory)

finalfit documentation built on Sept. 11, 2024, 9:01 p.m.