impliedS: Compute a Symbolic Model-Implied Covariance/Correlation...

Description Usage Arguments Value Author(s) Examples

View source: R/impliedS.R

Description

It computes a symbolic model-implied covariance (or correlation) matrix in SEM using the RAM inputs.

Usage

1
impliedS(RAM, corr=FALSE)

Arguments

RAM

A RAM object including a list of matrices of the model returned from lavaan2RAM

corr

Whether the model implied matrix is covariance (default) or correlation.

Value

The model implied covariance (or correlation) matrix.

Author(s)

Mike W.-L. Cheung <mikewlcheung@nus.edu.sg>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#### A mediation model
model1 <- "y ~ c*x + b*m
           m ~ a*x
           ## Means
           y ~ b0*1
           m ~ m0*1
           x ~ x0*1"
    
RAM1 <- metaSEM::lavaan2RAM(model1)

## Model-implied covariance matrix and mean structure
impliedS(RAM1, corr=FALSE)

## Model-implied correlation matrix
impliedS(RAM1, corr=TRUE)

#### A CFA model
model2 <- "f =~ x1 + x2 + x3 + x4"
    
RAM2 <- metaSEM::lavaan2RAM(model2)

## Model-implied covariance matrix
impliedS(RAM2, corr=FALSE)

## Model-implied correlation matrix
impliedS(RAM2, corr=TRUE)

symSEM documentation built on July 16, 2020, 9:06 a.m.