--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/c7e2d2cb-395f-40ac-bcba-c39899828e8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Holger,You may specify equality constraints by using the same parameter labels in the A and S matrices in both wls() and tssem2() in the metaSEM package.P.S. Since the question is not related to lavaan, it may be better to post them to https://openmx.ssri.psu.edu/forums/third-party-software/metasem.-----------------------------------------------------------------------
Mike W.L. Cheung Phone: (65) 6516-3702
Department of Psychology Fax: (65) 6773-1843
National University of Singapore
http://mikewlcheung.github.io/
---------------------------------------------------------------------
On Tue, Jun 11, 2019 at 9:07 PM 'Hollix00' via lavaan <lav...@googlegroups.com> wrote:
Hi folks,--usually I use M. Cheung's metaSEM packages to specify meta-analytical SEMs. Especially I use the wls() function. Now I would like to test equality of parameters via specifying equality constraints and found (I guess so) that this is not possible with the wls-function but only in his tssem-function. However, using tssem is not possible that my data is in a long format (multilevel structure) and not the tsssem-typical list format (in which each element is the correlation matrix of each primary study).Long story short: I would like to incorporate the pooled correlation matrix together with the asymptotic covariance matrix (ACM) in lavaan and use the wls-estimator there. However, I have not found any clue how to do this.Can anybody tell me how the syntax looks like (i.e., incorporating the matrices of two groups together with their ACMs) and testing for group differences?Best,Holger
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lav...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/35159a75-8508-4c64-b82f-30fed86a352d%40googlegroups.com.
The problem is with the correlation matrix: lavaan only accepts
covariance matrices (for continuous data), and when p=3, it expects ACOV
to be of dimension 6x6, but it gets 3x3.
I am afraid there is no easy fix for this one, until lavaan supports
correlations structures for continuous data.
nVariables <- dim(KM.ED)[1]
nMoments <- dim(Acov_ES.ED)[1]
## construct NACOV, appended with 1 threshold per variable to trick lavaan
NACOV <- matrix(0, nrow = nVariables + nMoments, ncol = nVariables + nMoments)
## lavaan expects thresholds first:
## - arbitrary sampling variance = weight = 1
## - no covariance with other estimates
diag(NACOV)[1:nVariables] <- 1
## remaining elements are the estimates you have
idx <- (nVariables + 1):(nVariables + nMoments)
NACOV[idx, idx] <- n.ED * Acov_ES.ED
## diagonally WLS (since lavaan thinks these are ordered variables)
WLS.V <- MASS::ginv(diag(diag(NACOV)))
## create arbitrary vector of thresholds == 0
sample.th <- rep(0, nVariables)
attr(sample.th, "th.idx") <- 1:nVariables
names(sample.th) <- names(attr(sample.th, "th.idx")) <- paste0(names(KM.ED), " | t1")
## fit model
fit.ED <- sem(mod.ed, sample.cov=KM.ED, sample.nobs = n.ED,
sample.th = sample.th, sample.means = rep(0, nVariables),
estimator="dwls", WLS.V=WLS.V, NACOV = NACOV)