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

create.modMatrix

Create a moderator matrix used in OSMASEM


Description

It creates a moderator matrix used in OSMASEM.

Usage

create.modMatrix(RAM, output=c("A", "S"), mod)

Arguments

RAM

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

output

Whether the output is an "A" or "S" matrix.

mod

A string of moderator in the dataset.

Value

A character matrix.

Author(s)

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

Examples

## A multiple regression model
model <- "y ~ x1 + x2
          x1 ~~ 1*x1
          x2 ~~ 1*x2
          x1 ~~ x2"

## RAM specification
RAM <- lavaan2RAM(model, obs.variables=c("y", "x1", "x2"))

## Create a moderator matrix on A with "meanAge as the moderator.
A1 <-  create.modMatrix(RAM=RAM, output="A", mod="meanAge")
A1

## Create a moderator matrix on S with "meanAge as the moderator.
S1 <-  create.modMatrix(RAM=RAM, output="S", mod="meanAge")
S1

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.