# \donttest{
## Sample means for the two constructs in Group 1
m1 <- c(2.5, 4.5)
## Sample means for the two constructs in Group 2
m2 <- c(3, 5)
## Sample covariance matrix in Group 1
V1 <- matrix(c(3,2,2,3), ncol=2)
## Sample covariance matrix in Group 2
V2 <- matrix(c(3.5,2.1,2.1,3.5), ncol=2)
## Sample size in Group 1
n1 <- 20
## Sample size in Group 2
n2 <- 25
## SMD with the assumption of homogeneity of covariance matrix
smdMES(m1, m2, V1, V2, n1, n2, homogeneity="cov", bias.adjust=TRUE,
lavaan.output=FALSE)
## SMD with the assumption of homogeneity of correlation matrix
smdMES(m1, m2, V1, V2, n1, n2, homogeneity="cor", bias.adjust=TRUE,
lavaan.output=FALSE)
## SMD without any assumption of homogeneity
smdMES(m1, m2, V1, V2, n1, n2, homogeneity="none", bias.adjust=TRUE,
lavaan.output=FALSE)
## Output the fitted lavaan model
## It provides a likelihood ratio test to test the null hypothesis of
## homogeneity of variances.
fit <- smdMES(m1, m2, V1, V2, n1, n2, homogeneity="cov", bias.adjust=TRUE,
lavaan.output=TRUE)
lavaan::summary(fit)
lavaan::parameterestimates(fit)
# }
Run the code above in your browser using DataLab