metaSEM (version 1.2.4)

Cor2DataFrame: Convert correlation or covariance matrices into a dataframe of correlations or covariances with their sampling covariance matrices

Description

It converts the correlation or covariance matrices into a dataframe of correlations or covariances with their asymptotic sampling covariance matrices. It uses the asyCov at the backend.

Usage

Cor2DataFrame(x, n, v.na.replace = TRUE, row.names.unique = FALSE,
              cor.analysis = TRUE, acov="weighted", ...)

Arguments

x

A correlation/covariance matrix or a list of correlation/covariance matrices.

n

Sample size or a vector of sample sizes

v.na.replace

Logical. Missing value is not allowed in definition variables. If it is TRUE (the default), missing value is replaced by a large value (1e10). These values are not used in the analysis.

row.names.unique

Logical, If it is FALSE (the default), unique row names are not created.

cor.analysis

Logical. The output is either a correlation or covariance matrix.

acov

If it is weighted, the average correlation/covariance matrix is calculated based on the weighted mean with the sample sizes. The average correlation/covariance matrix is used to calculate the sampling variance-covariance matrices.

Further arguments to be passed to asyCov.

Value

A list of components: (1) a data frame of correlations or covariances with their sampling covariance matrices; (2) a vector of sample sizes; (3) labels of the correlations; and (3) labels of their sampling covariance matrices.

See Also

asyCov, osmasem, create.vechsR, create.Tau2, create.V

Examples

Run this code
# NOT RUN {
my.df <- Cor2DataFrame(Nohe15A1$data, Nohe15A1$n)

## Data
my.df$data

## Sample sizes
my.df$n

## ylabels
my.df$ylabels

## vlabels
my.df$vlabels
# }

Run the code above in your browser using DataCamp Workspace