Learn R Programming

metaSEM (version 1.0.0)

Becker94: Five Studies of Ten Correlation Matrices reported by Becker and Schram (1994)

Description

This data set includes five studies of ten correlation matrices reported by Becker and Schram (1994).

Usage

data(Becker94)

Arguments

Details

A list of data with the following structure:

data

A list of 10 correlation matrices. The variables are SAT_Math, Spatial and SAT_Verbal

n

A vector of sample sizes

gender

Females or Males samples

Examples

Run this code
# NOT RUN {
data(Becker94)

#### Fixed-effects model
## First stage analysis
fixed1 <- tssem1(Becker94$data, Becker94$n, method="FEM")
summary(fixed1)

## Prepare a regression model using create.mxMatrix()
A1 <- create.mxMatrix(c(0,0,0,"0.2*Spatial2Math",
                        0,0,"0.2*Verbal2Math",0,0), type="Full",
                      ncol=3, nrow=3, name="A1")
S1 <- create.mxMatrix(c("0.2*ErrorVarMath",0,0,1,
                        "0.2*CorBetweenSpatialVerbal",1),
                      type="Symm", name="S1")

## An alternative method to create a regression model with the lavaan syntax
model <- "## Regression model
          SAT_Math ~ Spatial2Math*Spatial + Verbal2Math*SAT_Verbal
          ## Error variance of SAT_Math
          SAT_Math ~~ ErrorVarMath*SAT_Math
          ## Variances of Spatial and SAT_Verbal fixed at 1.0
          Spatial ~~ 1*Spatial
          SAT_Verbal ~~ 1*SAT_Verbal
          ## Correlation between Spatial and SAT_Verbal
          Spatial ~~ CorBetweenSpatialVerbal*SAT_Verbal"

RAM <- lavaan2RAM(model,
                  obs.variables=c("SAT_Math", "Spatial", "SAT_Verbal"))
RAM

A1 <- RAM$A
S1 <- RAM$S

## Second stage analysis
fixed2 <- tssem2(fixed1, Amatrix=A1, Smatrix=S1, intervals.type="LB")
summary(fixed2)


#### Fixed-effects model: with gender as cluster
## First stage analysis
cluster1 <- tssem1(Becker94$data, Becker94$n, method="FEM", cluster=Becker94$gender)
summary(cluster1)

## Second stage analysis  
cluster2 <- tssem2(cluster1, Amatrix=A1, Smatrix=S1, intervals.type="LB")
summary(cluster2)


#### Conventional fixed-effects GLS approach
## First stage analysis
## No random effects
## Replicate Becker's (1992) analysis using 4 studies only
gls1 <- tssem1(Becker92$data[1:4], Becker92$n[1:4], method="REM", RE.type="Zero",
               model.name="Fixed effects GLS Stage 1")
summary(gls1)

## Fixed-effects GLS model: Second stage analysis
gls2 <- tssem2(gls1, Amatrix=A1, Smatrix=S1, intervals.type="LB",
               model.name="Fixed effects GLS Stage 2")
summary(gls2)
# }

Run the code above in your browser using DataLab