-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost-lca-simul-analyze.do
72 lines (59 loc) · 2.08 KB
/
post-lca-simul-analyze.do
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
* read all the simulation files
frame change default
cap frame simul_results: drop _all
cap frame drop simul_results
frame create simul_results
frame change simul_results
* identify and read all the files
local resultfiles : dir "../code" files "postlca-simul-*.dta"
foreach f in `resultfiles' {
append using "../code/`f'"
}
sjlog using simul_failures, replace
tabulate method
sjlog close, replace
cap drop touse3
replace seed = rep if seed == .
bysort rep seed (method) : gen byte touse3 = (_N==3)
assert inlist(touse3, 0, 1)
* class probablities are biased
sjlog using simul_class1pr, replace
mean class1pr if touse3, over(n_method)
sjlog close, replace
* std errors are too small
sjlog using simul_class1pr_se, replace
bysort method (rep): sum class1pr if touse3
mean class1se if touse3, over(n_method)
sjlog close, replace
* variable in the model: target 0.3
sjlog using simul_y1cl2pr, replace
mean y1cl2pr if touse3 & y1cl2pr>0.01 & y1cl2pr<0.99, over(n_method)
sjlog close, replace
sjlog using simul_y1cl2pr_se, replace
bysort method (rep): sum y1cl2pr if touse3 & y1cl2pr>0.01 & y1cl2pr<0.99
mean y1cl2se if touse3 & y1cl2pr>0.01 & y1cl2pr<0.99, over(n_method)
sjlog close, replace
* variable in the model: target 0.5
sjlog using simul_y4cl1pr, replace
mean y4cl1pr if touse3 & y4cl1pr>0.01 & y4cl1pr<0.99, over(n_method)
sjlog close, replace
sjlog using simul_y4cl1pr_se, replace
bysort method (rep): sum y4cl1pr if touse3 & y4cl1pr>0.01 & y4cl1pr<0.99
mean y4cl1se if touse3 & y4cl1pr>0.01 & y4cl1pr<0.99, over(n_method)
sjlog close, replace
* variable not in the model: target 1
sjlog using simul_y6cl1pr, replace
mean y6cl1pr if touse3, over(n_method)
sjlog close, replace
sjlog using simul_y6cl1pr_se, replace
bysort method (rep): sum y6cl1pr if touse3
mean y6cl1se if touse3, over(n_method)
sjlog close, replace
* variable not in the model: target sqrt(3) == 1.73
sjlog using simul_y6cl3pr, replace
mean y6cl3pr if touse3, over(n_method)
sjlog close, replace
sjlog using simul_y6cl3pr_se, replace
bysort method (rep): sum y6cl3pr if touse3
mean y6cl3se if touse3, over(n_method)
sjlog close, replace