Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

checkRAM

Check the correctness of the RAM formulation


Description

It provides simple checks on the correctness of the RAM formulation.

Usage

checkRAM(Amatrix, Smatrix, cor.analysis=TRUE)

Arguments

Amatrix

An asymmetric matrix in the RAM specification with MxMatrix-class. If it is a matrix, it will be converted into MxMatrix-class by the as.mxMatrix function.

Smatrix

A symmetric matrix in the RAM specification with MxMatrix-class. If it is a matrix, it will be converted into MxMatrix-class by the as.mxMatrix function.

cor.analysis

Logical. Analysis of correlation or covariance structure. There are additional checks for cor.analysis=TRUE.

Value

It returns silently if no error has been detected; otherwise, it returns a warning message.

Author(s)

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

See Also

Examples

## Not run:  
## Digman97 example
model1 <- "## Factor loadings
           Alpha=~A+C+ES
           Beta=~E+I
           ## Factor correlation
           Alpha~~Beta"

RAM1 <- lavaan2RAM(model1, obs.variables=c("A","C","ES","E","I"),
                   A.notation="on", S.notation="with")
RAM1

## The model is okay.    
checkRAM(Amatrix=RAM1$A, Smatrix=RAM1$S)

## Hunter83 example    
model2 <- "## Regression paths
           Job_knowledge ~ A2J*Ability
           Work_sample ~ A2W*Ability + J2W*Job_knowledge
           Supervisor ~ J2S*Job_knowledge + W2S*Work_sample

           ## Fix the variance of Ability at 1
           Ability ~~ 1*Ability

           ## Label the error variances of the dependent variables
           Job_knowledge ~~ VarE_J*Job_knowledge
           Work_sample ~~ VarE_W*Work_sample
           Supervisor ~~ VarE_S*Supervisor"

RAM2 <- lavaan2RAM(model2, obs.variables=c("Ability","Job_knowledge",
                   "Work_sample","Supervisor"))

## The model is okay.     
checkRAM(Amatrix=RAM2$A, Smatrix=RAM2$S)   

## End(Not run)

metaSEM

Meta-Analysis using Structural Equation Modeling

v1.2.5
GPL (>= 2)
Authors
Mike Cheung [aut, cre] (<https://orcid.org/0000-0003-0113-0758>)
Initial release
2020-11-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.