Using metaSEM and loving it. But, I've encountered a problem using metaSEM with a data frame after I have deleted rows from that data frame -- or created a new data frame that is a subset of the rows in the original data frame. Fortunately, I've also discovered a work around - but the error is an odd one. I have attached the relevant files, but I'll describe it in detail here.
Imagine I have a data set then runs fine in metaSEM. If I create new data frame that is a subset of the original data frame the new data frame will not run in metaSEM. I've tried various ways of creating the new data frame, but the results is always the same. I get the following error:
*tmp*, "time", value = c(1L, 0L, 1L, 2L, 3L, :
replacement has 19 rows, data has 17
Oddly, I've found that if I take the data frame that will not run, save it to disk, load it, and run it, everything is fine.
Looks like a fix may possibly be needed in metaSEM or OpenMx - since the particular data doesn't seem to be the issue here.
print("Running: All Data")
if you uncomment this next bit, the program will crash with the above error
print("Running Subset Data: Error")
This work around save the day though...
print("Running Subset Data: saved and reloaded")