na.auxiliary: Auxiliary variables analysis

View source: R/na.auxiliary.R

na.auxiliaryR Documentation

Auxiliary variables analysis

Description

This function computes (1) Pearson product-moment correlation matrix to identify variables related to the incomplete variable and (2) Cohen's d comparing cases with and without missing values to identify variables related to the probability of missingness.

Usage

na.auxiliary(x, tri = c("both", "lower", "upper"), weighted = FALSE,
             correct = FALSE, digits = 2, as.na = NULL, check = TRUE,
             output = TRUE)

Arguments

x

a matrix or data frame with numeric vectors.

tri

a character string indicating which triangular of the correlation matrix to show on the console, i.e., both for upper and lower triangular, lower (default) for the lower triangular, and upper for the upper triangular.

weighted

logical: if TRUE (default), the weighted pooled standard deviation is used.

correct

logical: if TRUE, correction factor for Cohen's d to remove positive bias in small samples is used.

digits

integer value indicating the number of decimal places digits to be used for displaying correlation coefficients and Cohen's d estimates.

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.

output

logical: if TRUE, output is shown on the console.

Details

Note that non-numeric variables (i.e., factors, character vectors, and logical vectors) are excluded from to the analysis.

Value

Returns an object of class misty.object, which is a list with following entries:

call

function call

type

type of analysis

data

matrix or data frame specified in x

args

specification of function arguments

result

list with result tables, i.e., cor.mat for the correlation matrix and d.mat for Cohen's d

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.coverage, na.descript, na.indicator, na.pattern, na.prop, na.test

Examples

dat <- data.frame(x1 = c(1, NA, 2, 5, 3, NA, 5, 2),
                  x2 = c(4, 2, 5, 1, 5, 3, 4, 5),
                  x3 = c(NA, 3, 2, 4, 5, 6, NA, 2),
                  x4 = c(5, 6, 3, NA, NA, 4, 6, NA))

# Auxiliary variables
na.auxiliary(dat)

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

Related to na.auxiliary in misty...