All commands
# |
content
|
3 [+]
|
clear
All properties
key |
content |
command |
clear |
indent |
0 |
parameters |
|
|
4 [+]
|
set
obs 1000000
All properties
key |
content |
command |
set |
indent |
0 |
parameters |
obs 1000000 |
|
5 [+]
|
set
seed 20080616
All properties
key |
content |
command |
set |
indent |
0 |
parameters |
seed 20080616 |
|
6 [+]
|
g
nchild = int(12*uniform())+1
|
7 [+]
|
forv
i=1/12 {
All properties
key |
content |
command |
forv |
indent |
0 |
parameters |
i=1/12 { |
|
8 [+]
|
qui
g
child`i' = cond(nchild >= `i',int(30 * uniform()) + 1, .)
|
9 [+]
|
}
All properties
key |
content |
command |
} |
indent |
0 |
parameters |
|
|
10 [+]
|
su
All properties
key |
content |
command |
su |
indent |
0 |
parameters |
|
|
11 [+]
|
save
ex4.1
, replace
All properties
key |
content |
command |
save |
indent |
0 |
options |
replace |
parameters |
ex4.1 |
|
13 [+]
|
set
rmsg on
All properties
key |
content |
command |
set |
indent |
0 |
parameters |
rmsg on |
|
14 [+]
|
egen
nschool = rcount(child1-child12)
, cond(@ > 5 & @ < 19)
|
16 [+]
|
drop
nschool
All properties
key |
content |
command |
drop |
indent |
0 |
parameters |
nschool |
|
17 [+]
|
generate
nschool = 0
All properties
key |
content |
command |
generate |
indent |
0 |
parameters |
nschool = 0 |
|
18 [+]
|
foreach
v of varlist child1-child12 {
|
19 [+]
|
qui
replace
nschool = nschool + inrange(`v', 6, 18)
|
20 [+]
|
}
All properties
key |
content |
command |
} |
indent |
0 |
parameters |
|
|
22 [+]
|
drop
nschool
All properties
key |
content |
command |
drop |
indent |
0 |
parameters |
nschool |
|
23 [+]
|
generate
nschool = 0
All properties
key |
content |
command |
generate |
indent |
0 |
parameters |
nschool = 0 |
|
24 [+]
|
generate
anyschool = 0
All properties
key |
content |
command |
generate |
indent |
0 |
parameters |
anyschool = 0 |
|
25 [+]
|
foreach
v of varlist child1-child12 {
|
26 [+]
|
qui
replace
nschool = nschool + inrange(`v', 6, 18)
|
27 [+]
|
qui
replace
anyschool = max(anyschool, inrange(`v', 6, 18))
|
28 [+]
|
}
All properties
key |
content |
command |
} |
indent |
0 |
parameters |
|
|
30 [+]
|
drop
nschool
All properties
key |
content |
command |
drop |
indent |
0 |
parameters |
nschool |
|
31 [+]
|
drop
anyschool
All properties
key |
content |
command |
drop |
indent |
0 |
parameters |
anyschool |
|
32 [+]
|
local
nschool 0
All properties
key |
content |
command |
local |
indent |
0 |
parameters |
nschool 0 |
|
33 [+]
|
foreach
v of varlist child1-child12 {
|
34 [+]
|
local
nschool "`nschool' + inrange(`v', 6, 18)"
|
35 [+]
|
}
All properties
key |
content |
command |
} |
indent |
0 |
parameters |
|
|
36 [+]
|
di
"`nschool'"
All properties
key |
content |
command |
di |
indent |
0 |
parameters |
"`nschool'" |
|
37 [+]
|
generate
byte nschool = `nschool'
|
38 [+]
|
generate
byte anyschool = nschool > 0
|
41 [+]
|
set
rmsg off
All properties
key |
content |
command |
set |
indent |
0 |
parameters |
rmsg off |
|