Attachment | Size |
---|---|
matrix.dat [6] | 62.18 KB |
Hi Mike,
I am currently trying to fit a multivariate metaSEM model. I am getting a non-positive definite matrix when fitting a random effects model, and this is likely expected due to a lot missing data in the attached datafile. Would you agree that this is the reason behind the non-positive definite error? Please also note that I tried running the model with fewer studies that provided more data (the number of studies went from 108 to 44) but the errors were the same.
Additionally, I can’t seem to fit the fixed effects model. Given that I am new to R, I was hoping you could look at my code below and let me know how you have handled “NA” or missing values in metaSEM. Below is all the code I have used, as well as the errors.
Thanks in advance,
Yusra
importing the dataset with a matrix for each sample
my.full <- readFullMat("T:/matrix.dat")
creating an object with the sample sizes
n <- ("100 100 100 100 100 100 241 45 70 122 119 119 447 56 41 38 103 57 192 105 62 48 56 123 56 123 121 103 300 128 106 20 17 75 10 19 21 492 153 107 71 123 23 15 14 22 131 727 30 297 60 125 37 140 88 182 735 45 300 300 77 136 162 65 166 60 75 87 59 57 97 129 242 83 54 78 75 30 60 105 65 64 92 101 120 88 144 120 464 104 296 120 121 95 76 60 256 251 317 52 622 80 297 171 98 354 690 88")
random effects model
> random.full <- tssem1(my.full, n, method = "REM", RE.type="Symm", RE.startvalues=0.1, RE.lbound=1e-10, I2="I2q", model.name=NULL,suppressWarnings=TRUE)
Error in function (x, n, cor.analysis = TRUE, dropNA = FALSE, as.matrix = TRUE, :
x is not positive definite!
fixed effects model
> fixed1 <- tssem1(my.full$data, n$n, method = "FEM", cor.analysis = TRUE, cluster = NULL, RE.type= "Symm", suppressWarnings=FALSE)
Error in !all.equal(my.range[1], my.range[2]) : invalid argument type
In addition: Warning messages:
1: In min(x, na.rm = na.rm) :
no non-missing arguments to min; returning Inf
2: In max(x, na.rm = na.rm) :
no non-missing arguments to max; returning -Inf