How to run a simulation code multiple times and generate a mean output
I wrote some code to run a simulation model- I want to run this model at least 100 times. After running 100 times, I want it to calculate a mean for the sensitivity values produced for each screen age- for example, after 100 runs of my code, I will have 100 sensitivity values associated with screen.age = 50, I want to calculate the mean of all these values as well as a confidence interval to get a mean sensitivity for screen.age 50.
This is my initial data frame that was generated when I only ran my code once.