svy_miss_var_summary: Create overview over missing data in survey object

View source: R/svy_helpers.R

svy_miss_var_summaryR Documentation

Create overview over missing data in survey object

Description

This function creates a tibble that summarizes missing data with survey weights for missing counts and proportions. (Apart from that, it recreates the naniar::miss_var_summary() output.)

Usage

svy_miss_var_summary(
  svy_data,
  ...,
  .any_missing = TRUE,
  .include_complete = FALSE
)

Arguments

svy_data

A survey object created with the survey package

...

Variables to consider. By default this looks at the whole dataset. Otherwise, this should be one or more unquoted expressions separated by commas, or a tidyselect helper function (e.g., starts_with() or where(is.numeric)).

.any_missing

Should a row be shown at the start of the return with the number and share of (weighted) responses that have missing data on at least one of the variables considered? Defaults to TRUE.

.include_complete

Should variables with no missing data be included in the returned tibble? Defaults to FALSE.

Examples

library(survey)
data(api)
svy_df <- svydesign(id = ~1, strata = ~stype, weights = ~pw, 
                   data = apistrat, fpc = ~fpc)

svy_miss_var_summary(svy_df, acs.core, target, name)    

LukasWallrich/timesaveR documentation built on Nov. 29, 2024, 4:47 a.m.