library(metaSEM) # Input correlation matrices dt <- readFullMat("cordata1.txt") mtnam1 <- c("V1", "V2", "V3", "V4", "V5", "V6", "V7", "V8", "V9", "V10", "V11", "V12") dt <- lapply(dt, function(x) { dimnames(x) <- list(mtnam1, mtnam1) x}) # Input sample sizes sn <- as.numeric(read.table("samplesize.txt")) # Combine correlation matrices and sample sizes to create a list of semdata semdata <- list(data=dt, n=sn ) ## Run random-effect model to compute the correlations and population variability τ2 for MASEM stage1random <- tssem1(semdata$data, n=semdata$n, method="REM") # Retrieve the results of random-effect model summary(stage1random) #Error in 1:(rsum * csum) : NA/NaN argument #In addition: Warning message: #In rsum * csum : NAs produced by integer overflow