Compute covariance or correlation matrix with treatments for clusters and missing values
cor_nest(.data, ..., cluster = NULL, missing = "fiml", ordered = FALSE, pvalue = FALSE)cov_nest(.data, ..., cluster = NULL, missing = "fiml", ordered = FALSE, pvalue = FALSE)
A list of class "covnest"
a data frame, a numeric matrix.
further arguments.
a variable name defining the clusters in a two-level dataset in the data frame.
treatment to deal with missing values. Options are "listwise" or "pairwise". Default if "fiml".
a character vector identifying which variables have an ordered (ordinal) scale. If TRUE, all observed endogenous variables are treated as ordered (ordinal). If FALSE, all observed endogenous variables are considered to be numeric
an argument to indicate if \(p\)-values are required.
A quick adaptation of the lavaan package (Rosseel, 2012) to estimate a covariance or correlation matrix with missing values, hierachical strcutures and ordinal scales.
Rosseel, Y. (2012). lavaan: An R package for structural equation modeling. Journal of Statistical Software, 48(2), 1–36. https://www.jstatsoft.org/v48/i02/