na.prop: Proportion of Missing Data for Each Case

View source: R/na.prop.R

na.propR Documentation

Proportion of Missing Data for Each Case

Description

This function computes the proportion of missing data for each case in a matrix or data frame.

Usage

na.prop(x, digits = 2, as.na = NULL, check = TRUE)

Arguments

x

a matrix or data frame.

digits

an integer value indicating the number of decimal places to be used for displaying proportions.

as.na

a numeric vector indicating user-defined missing values, i.e. these values are converted to NA before conducting the analysis.

check

logical: if TRUE, argument specification is checked.

Value

Returns a numeric vector with the same length as the number of rows in x containing the proportion of missing data.

Author(s)

Takuya Yanagida takuya.yanagida@univie.ac.at

References

Enders, C. K. (2010). Applied missing data analysis. Guilford Press.

Graham, J. W. (2009). Missing data analysis: Making it work in the real world. Annual Review of Psychology, 60, 549-576. https://doi.org/10.1146/annurev.psych.58.110405.085530

van Buuren, S. (2018). Flexible imputation of missing data (2nd ed.). Chapman & Hall.

See Also

as.na, na.as, na.auxiliary, na.coverage, na.descript, na.indicator, na.pattern, na.test

Examples

dat <- data.frame(x = c(1, NA, NA, 6, 3),
                  y = c(7, NA, 8, 9, NA),
                  z = c(2, NA, 3, NA, 5))

# Compute proportion of missing data (\code{NA}) for each case in the data frame
na.prop(dat)

misty documentation built on Nov. 15, 2023, 1:06 a.m.

Related to na.prop in misty...