-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsiman_examples.log
More file actions
208 lines (173 loc) · 6.69 KB
/
siman_examples.log
File metadata and controls
208 lines (173 loc) · 6.69 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
--------------------------------------------------------------------------------
name: <unnamed>
log: c:\ian\git\siman\siman_examples.log
log type: text
opened on: 18 Dec 2025, 09:51:52
. /*
> siman demonstration for paper
> IW 24jul2025
> */
.
. // OPEN DATA AND INTRODUCE SOME ERRORS
.
. use simcheck, clear
(Simulation results from simcheck99.do in paper doi:10.1093/ije/dyad134)
. gen estimand = "logOR"
. * changes to insert some errors
. * dgms are repeated, for dgm=MNAR
. replace b = b[_n-300] if rep>100 & dgm=="MNAR"
(2,700 real changes made)
. replace se = se[_n-300] if rep>100 & dgm=="MNAR"
(2,700 real changes made)
. replace df = df[_n-300] if rep>100 & dgm=="MNAR"
(900 real changes made)
. * 1 in 3 of SEs are too small, for method=MI
. replace se = se/2 if method==3 & mod(rep,3)==0
(999 real changes made)
.
. // RUN SIMAN SETUP
. siman setup, rep(rep) dgm(dgm) method(method) target(estimand) est(b) se(se) d
> f(df) true(0)
Warning: dgm variable dgm has been converted from string to numeric. If you
require its levels to be ordered differently, encode dgm as numeric before
running -siman setup-.
Warning: siman setup found unwanted variables: N
SUMMARY OF DATA
_____________________________________________________
Data-generating mechanism (DGM)
DGM variables (# levels): dgm (3)
Total number of DGMs: 3
Targets
Variable containing targets: estimand
Number of targets: 1
Target values: logOR
Methods
Variable containing methods: method
Number of methods: 3
Method values: Full; CCA; MI
Repetition-level output
Point estimate variable: b
SE variable: se
df variable: df
Conf. limit variables: -
p-value variable: -
True value variable: _true (created)
Estimates data in data
Performance statistics not in data
_____________________________________________________
.
. // GRAPHS OF ESTIMATES
.
. * siman swarm
. siman swarm, row(1) xsize(5) ysize(3) meangr(mcol(black))
Ignoring non-varying estimand
siman swarm will draw 1 graph with 3 panels
.
. * siman scatter
. siman scatter, xsize(5) ysize(3)
siman scatter will draw 1 graph with 9 panels
.
. * siman cms
. siman comparemethodsscatter if dgm == 3, xsize(4) ysize(3)
siman comparemethodsscatter will draw 1 graph showing 3 methods
Graph cms_1 is for dgm=MNAR, estimand=logOR
.
. * siman blandaltman
. siman blandaltman if dgm == 3, xsize(5) ysize(3)
siman blandaltman will draw 1 graph with 2 panels
.
. * siman zipplot
. siman zipplot, xsize(5) ysize(5)
siman zipplot will draw 1 graph with 9 panels
.
. // COMPUTE PERFORMANCE ESTIMATES
.
. use simcheck, clear
(Simulation results from simcheck99.do in paper doi:10.1093/ije/dyad134)
. qui siman setup, rep(rep) dgm(dgm) method(method) est(b) se(se) df(df) true(0)
. siman analyse
Warning: missing values in df()
siman analyse has run successfully
. siman table bias empse, row(_perf dgm) nformat(%6.3f)
------------------------------------------------------
| method
| Full CCA MI
---------------------------+--------------------------
Performance measure |
Bias |
Missing data mechanism |
MCAR |
Estimate | -0.000 -0.008 0.000
MCSE | 0.013 0.016 0.014
MAR |
Estimate | -0.017 -0.160 -0.020
MCSE | 0.014 0.018 0.015
MNAR |
Estimate | -0.006 -0.030 0.049
MCSE | 0.014 0.017 0.015
Empse |
Missing data mechanism |
MCAR |
Estimate | 0.426 0.516 0.454
MCSE | 0.010 0.012 0.010
MAR |
Estimate | 0.434 0.581 0.462
MCSE | 0.010 0.013 0.010
MNAR |
Estimate | 0.431 0.539 0.460
MCSE | 0.010 0.012 0.010
------------------------------------------------------
.
. // GRAPHS OF PERFORMANCE
.
. * siman lollyplot
. siman lollyplot, legend(row(1)) labformat(%6.3f %6.0f) xsize(5) ysize(3)
Performance measures not specified: defaulting to bias empse cover
siman lollyplot will draw 1 graph with 9 panels (3 PMs by 3 DGMs)
.
. * siman nestloop
. use extendedtestdata, clear
. siman setup, rep(rep) dgm(beta pmiss mech) method(method) target(estimand) est
> (b) se(se) true(true)
Warning: dgm variable mech has been converted from string to numeric. If you
require its levels to be ordered differently, encode mech as numeric before
running -siman setup-.
Warning: dgm variable beta has non-integer values: converting from float to
double (0 real changes made)
Warning: dgm variable pmiss has non-integer values: converting from float to
double (108,000 real changes made)
SUMMARY OF DATA
_____________________________________________________
Data-generating mechanism (DGM)
DGM variables (# levels): beta (3) pmiss (2) mech (2)
Total number of DGMs: 12
Targets
Variable containing targets: estimand
Number of targets: 3
Target values: effect; mean0; mean1
Methods
Variable containing methods: method
Number of methods: 3
Method values: CCA; MeanImp; Noadj
Repetition-level output
Point estimate variable: b
SE variable: se
df variable: -
Conf. limit variables: -
p-value variable: -
True value variable: true
Estimates data in data
Performance statistics not in data
_____________________________________________________
. siman analyse
siman analyse has run successfully
. siman nestloop empse if estimand=="effect", stagger(.05) lcol(black = =) lwidt
> h(1 = =) xsize(5) ysize(3)
siman nestloop will draw 1 graphs (1 targets * 1 performance measures)
.
end of do-file
name: <unnamed>
log: c:\ian\git\siman\siman_examples.log
log type: text
closed on: 18 Dec 2025, 09:52:10
--------------------------------------------------------------------------------