Learn R Programming

Rnest (version 1.2)

cov_nest: Compute covariance or correlation matrix with treatments for clusters and missing values

Description

Compute covariance or correlation matrix with treatments for clusters and missing values

Usage

cor_nest(.data, ..., cluster = NULL, missing = "fiml", ordered = FALSE, pvalue = FALSE)

cov_nest(.data, ..., cluster = NULL, missing = "fiml", ordered = FALSE, pvalue = FALSE)

Value

A list of class "covnest"

Arguments

.data

a data frame, a numeric matrix.

...

further arguments.

cluster

a variable name defining the clusters in a two-level dataset in the data frame.

missing

treatment to deal with missing values. Options are "listwise" or "pairwise". Default if "fiml".

ordered

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

pvalue

an argument to indicate if \(p\)-values are required.

Details

A quick adaptation of the lavaan package (Rosseel, 2012) to estimate a covariance or correlation matrix with missing values, hierachical strcutures and ordinal scales.

References

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/

Examples

Run this code
cov_nest(airquality)

Run the code above in your browser using DataLab