I am seeing that the re_tableonly stores result for a single loop, not for all the loops. How can I save all the results?
Another query is, as per the tutorial of metafor the summary(ma_model) command should show heterogeneity of the data like: tau^2, I^2, Q value, etc. I am getting only the Q-value information and that too for only one loop. How can I get all of them for all the loops?
Here's what I get when I use summary(ma_model):
There is an easy way to do it. You simply need re_table as a list. So in my example below my_list would work similar to your re_table where we assign each then. Have a look at my_list after the loop
I am not sure reprex of which portion do you want. Actually it is a long script and lots of data are there.
Secondly, the problem lies in the ma_model. I want all the ma_model value for all the loops. It gives result for only a single loop which is
A reprex is meant to represent your problem as a minimal reproducible example. The code I provides shows how you would be able to assign repeatedly to an object and be able to look at all the values. Without having your code as a more simple example I cannot see how you're trying to incorporate it and can't really advise. If you're getting the same result then re_table is probably not a list and probably not assigning it to lists as re_table[[i]]
Hi thanks for your time. Is it possible for you to use the data frame in the referred query? I am also using the same code that has been used in the referred query.
(I am referring you to that question because it is really difficult to create a reprex of my data. As, I am working with a very complex data)
To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:
You could use a list structure to save the output using the for loop indices. You could also try using a matrix. For a large dataset I would suggest defining the size of the matrix. Increasing matrix size dynamically is time consuming and your program will take a long time to run.
Try a small dataset first. Get that to work, then scale up. Starting with the full data set will waste your time making mistakes that should have been solved with a small mockup. If you can get the program to work with five variables then you understand it well enough to scale up.