Learn R Programming

metaSEM (version 1.4.0)

Roorda11: Studies on Students' School Engagement and Achievement Reported by Roorda et al. (2011)

Description

The data set includes 45 studies on the influence of affective teacher-student relationships on students' school engagement and achievement reported by Roorda et al. (2011).

Usage

data(Roorda11)

Arguments

Details

The variables are:

data

A list of 45 studies of correlation matrices. The variables are pos (positive teacher-student relations), neg (negative teacher-student relations), enga (student engagement), and achiev (student achievement).

n

A vector of sample sizes

SES

A vector of average socio-economic status (SES) of the samples

References

Jak, S., & Cheung, M. W.-L. (2018). Addressing heterogeneity in meta-analytic structural equation modeling using subgroup analysis. Behavior Research Methods, 50, 1359-1373.

Examples

Run this code
# \donttest{

## Random-effects model: First stage analysis
random1 <- tssem1(Cov = Roorda11$data, n = Roorda11$n, method = "REM",
                  RE.type = "Diag")
summary(random1)

varnames <- c("pos", "neg", "enga", "achiev")

## Prepare a regression model using create.mxMatrix()
A <- create.mxMatrix(c(0,0,0,0,
                       0,0,0,0,
                       "0.1*b31","0.1*b32",0,0,
                       0,0,"0.1*b43",0),
                     type = "Full", nrow = 4, ncol = 4, byrow = TRUE,
                     name = "A", as.mxMatrix = FALSE)

## This step is not necessary but it is useful for inspecting the model.
dimnames(A) <- list(varnames, varnames)
A

S <- create.mxMatrix(c(1,
                       ".5*p21",1,
                       0,0,"0.6*p33",
                       0,0,0,"0.6*p44"), 
                     type="Symm", byrow = TRUE,
                     name="S", as.mxMatrix = FALSE)

## This step is not necessary but it is useful for inspecting the model.
dimnames(S) <- list(varnames, varnames)
S

## Random-effects model: Second stage analysis
random2 <- tssem2(random1, Amatrix=A, Smatrix=S, diag.constraints=TRUE, 
                  intervals="LB")
summary(random2)

## Display the model with the parameter estimates    
plot(random2)
# }

Run the code above in your browser using DataLab