You are here

Testing homogeneity with homoStat!

2 posts / 0 new
Last post
g.iuli's picture
Offline
Joined: 11/13/2021 - 06:10
Testing homogeneity with homoStat!

Hi everyone,
I conducted a two-stage metaSEM with fixed effect model, since the random effect model reported estimation problem (after more then 5 hours running the first stage it never gave an output!).

Anyway, I am trying to compute the homogeneity statistics by using the homoStat function:
homoStat(y, v)
where, y: A vector of effect size for univariate meta-analysis or a k x p matrix of effect sizes for multivariate meta-analysis where k is the number of studies and p is the number of effect sizes.
v: A vector of the sampling variance of the effect size for univariate meta-analysis or a k x p* matrix of the sampling covariance matrix of the effect sizes for multivariate meta-analysis where p* = p(p+1)/2. It is arranged by column major as used by vech. It is assumed that there is no missing value in v if y is complete. If there are missing values in v due to the missingness on y, the missing values in v will be removed automatically.

I managed to compute the y matrix, but I am having difficulties computing the covariance matrix of the effect sizes for multivariate meta-analysis.
The coding is: sampcov <- vech(cov(y))
The output is a matrix of 1 column and 78 rows, and when I put it in the homoStat function I get this error message: Error in homoStat(y, sampcov) : The expected no. of columns in v is 78 while the observed no. of columns in v is 1..
I tried to switch the column and rows, but then I get this other error message: Error in V[!miss.index, !miss.index, drop = FALSE] : (subscript) logical subscript too long.

What am I missing?
I do not understand what I did wrong.

Thank you in advance!

Mike Cheung's picture
Offline
Joined: 10/08/2009 - 22:37
If it took more than 5 hours

If it took more than 5 hours to run your model, the model was either very huge or insufficient data.

The sampling covariance matrix in a meta-analysis is known. Thus, using cov(y) is incorrect. If your data are correlation matrices, you may use the asyCov() function to calculate them. But I would prefer to calculate it as a by-product of the tssem1() analysis.