I want to simulate data and analyze them for 1000 times, then I need all 1000 dataset that are simulated in order to analyze them with another approach and compering the results of two approaches, BUT I don't know how to save dataset
1. How to save the results of simulating software ('stata'), not only see it on the screen, or
2. What is the input data format (organization) recognizable by the "other software?"
In both cases familiarization with appropriate manuals seems unavoidable.
But, maybe, you are asking whether 1000 results should be stored as a single big disk file or as 1000 individual files? In the second case you probably will be better of to save all files in a separate disk path, with individual files having names ending with something like '0000.dat', '0001.dat', and so on. In the first case you have to be able to append new data series to an existing file, adding some extra separator (empty line?) between successive series.
You can save the estimates from each simulation by using the save() option. For example, let's say you created a program called mysim. Then you run the simulate command as follows:
I have done your suggestion BUT it seems simulate() function does not use that dataset!
for example the mean of x in my first dateset (sim1.dta) is 2 but in first line in simulation program which must be corresponded to first dataset is 9!!
Amir, you need to save the data after generating it in the data generating process, not at the stage you implement simulate. When you save the results from simulate, then those are the summary results stored in r().