na.prop | R Documentation |
This function computes the proportion of missing data for each case in a matrix or data frame.
na.prop(..., data = NULL, digits = 2, append = TRUE, name = "na.prop",
as.na = NULL, check = TRUE)
... |
a matrix or data frame with incomplete data, where missing
values are coded as |
data |
a data frame when specifying one or more variables in the
argument |
name |
a character string indicating the name of the variable appended
to the data frame specified in the argument |
.
append |
logical: if |
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 |
check |
logical: if |
Returns a numeric vector with the same length as the number of rows in x
containing the proportion of missing data.
Takuya Yanagida takuya.yanagida@univie.ac.at
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.
as.na
, na.as
, na.auxiliary
,
na.coverage
, na.descript
, na.indicator
,
na.pattern
, na.test
# Example 1a: Compute proportion of missing data for each case in the data frame
na.prop(airquality)
# Example 1b: Alternative specification using the 'data' argument,
# append proportions to the data frame 'airquality'
na.prop(., data = airquality)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.