The name is absent



Stata Technical Bulletin

23


There must be the same number of results following the post command as variable names following the global S_1 command.

Example

Make a data set containing means and variances of 100-observation samples from a log-normal distribution. Perform the
experiment 10,000 times:

program define Insim
version 3.1
ɪf
h-1-h==h?h {

global S.1 "mean var,
exit

drop .all

set obs 100

gen z = exp(invnorm(unif orm() ) )
summarize z

post .result(3) .result(4)

end


It is instructive to compare this program to the same example in the previous insert. In any case, Insim can then be executed
10,000 times by typing:

. simul Insimt reps(10000)
. describe

Contains data
Obs: 10000 (max= 19997)
Vars:     2 (max=    99)

Width:     8 (max=   200)

1. mean         float %9.0g

2. var          float %9.0g

Sorted by:
. summarize
Variable
    Obs        Mean   Std. Dev.       Min        Max

---------+-----------------------------------------------------
mean
  10000    1.648349   .2165937   1.022719   4.280587

var I   10000    4.720659   6.208903   .6215334   450.1076

The simul command took 14.5 minutes on a 25MHz DOS 486 computer.

Technical note: debugging a simulation

Before executing our Insim simulator, we can verify it works by typing
. Insim
. display $S_1

This verifies that the program sets the global macro $S_1 correctly on a query call. We can then try executing lnsim:

. postfile $S_1 using myfile
. Insim

The postfile command opens a file for the posted results (see insert above). Invoking Insim should perform a single simulation.
We could then close the result file and examine it:

. postclos

. use myfile, clear

Passing arguments to the simulation

Consider a more complicated problem: Let’s experiment with estimating

yj = a + bxj + Uj

when the true model has a = 1, b = 1, and Uj = 2(¾ + c¾∙) and Zj is N(0,1). We will keep the parameter estimates and
standard errors and experiment with varying
c. Xj will be fixed across the experiments but will originally be generated as N(0,1).
We begin by interactively making the true data:



More intriguing information

1. IMPROVING THE UNIVERSITY'S PERFORMANCE IN PUBLIC POLICY EDUCATION
2. Who is missing from higher education?
3. The name is absent
4. Asymmetric transfer of the dynamic motion aftereffect between first- and second-order cues and among different second-order cues
5. Research Design, as Independent of Methods
6. The name is absent
7. Literary criticism as such can perhaps be called the art of rereading.
8. Nach der Einführung von Arbeitslosengeld II: deutlich mehr Verlierer als Gewinner unter den Hilfeempfängern
9. The name is absent
10. LABOR POLICY AND THE OVER-ALL ECONOMY
11. Tariff Escalation and Invasive Species Risk
12. The name is absent
13. Computational Experiments with the Fuzzy Love and Romance
14. Road pricing and (re)location decisions households
15. The name is absent
16. Comparison of Optimal Control Solutions in a Labor Market Model
17. The name is absent
18. Dual Track Reforms: With and Without Losers
19. Financial Development and Sectoral Output Growth in 19th Century Germany
20. Endogenous Determination of FDI Growth and Economic Growth:The OECD Case