Little (1988, eq. 2): \(d^2 = \sum_j n_j (\bar y_j - \mu_j)^T \Sigma_j^{-1} (\bar y_j - \mu_j)\) over the missingness patterns, with the maximum-likelihood mean and covariance from EM restricted to each pattern's observed variables, referred to chi-square on \(\sum_j p_j - p\) df. Rows with nothing observed are dropped.
References
Little, R. J. A. (1988). A test of missing completely at random for multivariate data with missing values. JASA 83, 1198-1202.
Examples
X <- data.frame(a = c(1, 2, NA, 4, 5, 6), b = c(2, NA, 3, 5, 4, 7))
littles_mcar_test(X)
#> $test_statistic
#> [1] 1.40974
#>
#> $p_value
#> [1] 0.4941728
#>
#> $df
#> [1] 2
#>
#> $n_patterns
#> [1] 3
#>
#> $method
#> [1] "Little's MCAR test"
#>
