Error running REM in tssem1

2 replies [Last post]
Anonymous's picture
Anonymous

Hi Mike,
I am enjoying so much your package MetaSEM, thanks a lot! This is making a great advance in meta-analysis.
I am having a bit of problem running random effects with tseem1, any help would be very much appreciated!
I am trying to replicate Digman97 using a larger sample, here an example of a reduced sample of my data and the error I got.
> random1 <- tssem1(neo$data, neo$n, method="REM", RE.type="Diag")
Error: The reference '21' in mxMatrix("Stand", nrow = p, ncol = p, free = TRUE, values = jitter(vechs(cov2cor(x.new))), name = "S", labels = acovName) is illegal because it can be interpreted as a number

Am I missing anything?
Thanks in advanced!
Laura.

[img_assist|nid=3383|title=Error running REM in tssem1|desc=|link=none|align=left|width=100|height=50]

AttachmentSize
ex.xls84 KB
neo.R803 bytes
Mike Cheung's picture
Offline
Joined: 10/08/2009
Hi, Laura. The problem is

Hi, Laura.

The problem is that the dimnames of the matrices are different. The row names are 1 to 5, e.g.,,
> neo
$data
$data[[1]]
n e o a c
1 1.00 -0.30 -0.02 -0.10 -0.34
2 -0.30 1.00 0.39 0.02 0.07
3 -0.02 0.39 1.00 0.03 -0.04
4 -0.10 0.02 0.03 1.00 0.21
5 -0.34 0.07 -0.04 0.21 1.00

After fixing it with the following code, it should work.
neo$data <- lapply(neo$data, function(x) { dimnames(x)[[1]] <- c("n","e","o","a","c"); x})

Cheers,
Mike

Anonymous's picture
Laura Nuno (not verified)
Thank you very much for your

Thank you very much for your quick answer, it has worked!