View source: R/missing_data_diagnostics.R
| analyze_missing_pattern | R Documentation |
Summarises where missingness sits in an omics layer before a LUCID model is fitted, so that the choice between listwise and sporadic handling can be made from the data rather than assumed. Reports missingness by feature and by subject, flags the features and subjects that are more than half missing, and counts the distinct missingness patterns present.
The number of distinct patterns is the diagnostic that matters most for cost: the observed-data likelihood is evaluated once per pattern, so a matrix with few patterns (largely listwise missingness) is far cheaper to fit than one of the same sparsity spread over many patterns.
analyze_missing_pattern(Z)
Z |
An N by M omics matrix, or an object coercible to one by
|
A list with components:
Proportion missing for each of the M features.
Proportion missing for each of the N subjects.
Integer indices of features more than half missing.
Integer indices of subjects more than half missing.
Number of subjects with no missing feature.
Number of distinct missingness patterns, counting the complete pattern if any subject is complete.
Proportion of missing cells over the whole matrix.
check_na, which classifies subjects into the complete /
sporadic / listwise categories the EM algorithm branches on.
Z <- matrix(rnorm(200), nrow = 20)
Z[1:3, 1] <- NA
Z[5, ] <- NA
analyze_missing_pattern(Z)[c("n_complete", "n_patterns", "total_missing")]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.