-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhardcoding.do
More file actions
32 lines (30 loc) · 865 Bytes
/
hardcoding.do
File metadata and controls
32 lines (30 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
qui {
cls
use ${repo}transplants, clear
ds, not(type string)
global threshold 9
putexcel set levelsof, replace
local row=2
foreach v of varlist age gender race { //`r(varlist)'
levelsof `v', local(numlevels)
if r(r) == 2 {
putexcel A`row' = ("`v'") B`row' = ("per")
noi di _col(1) "`v'" _col(30) "per"
local row = `row' + 1
}
else if inrange(`r(r)', 3, $threshold) {
putexcel A`row' = ("`v', %") B`row' = ("")
noi di _col(1) "`v', %" _col(30) ""
foreach l of numlist `numlevels' {
local row = `row' + 1
putexcel A`row' = (" catlab") B`row' = ("per")
noi di _col(1) " catlab" _col(30) "per"
}
}
else {
putexcel A`row' = ("`v'") B`row' = ("m_iqr")
noi di _col(1) "`v'" _col(30) "m_iqr"
local row = `row' + 1
}
}
}