/
f_sensitivity.Rmd
235 lines (188 loc) · 5.4 KB
/
f_sensitivity.Rmd
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
---
title: "Deterministic Sensitivity Analysis"
date: "`r Sys.Date()`"
output:
rmarkdown::html_vignette:
toc: true
vignette: >
%\VignetteIndexEntry{Deterministic Sensitivity Analysis}
%\VignetteEngine{knitr::rmarkdown}
\usepackage[utf8]{inputenc}
---
```{r, echo=FALSE, include=FALSE}
library(heemod)
param <- define_parameters(
rr = .509,
p_AB_base = .202,
p_AC_base = .067,
p_AD_base = .010,
p_BC_base = .407,
p_BD_base = .012,
p_CD_base = .250,
p_AB = p_AB_base,
p_AC = p_AC_base,
p_AD = p_AD_base,
p_BC = p_BC_base,
p_BD = p_BD_base,
p_CD = p_CD_base,
cost_zido = 2278,
cost_lami = 2086,
cost_A = 2756,
cost_B = 3052,
cost_C = 9007,
dr = .06
)
mat_trans_mono <- define_transition(
C, p_AB, p_AC, p_AD,
.000, C, p_BC, p_BD,
.000, .000, C, p_CD,
.000, .000, .000, 1.00
)
mat_trans_comb <- define_transition(
C, p_AB * rr, p_AC * rr, p_AD * rr,
.000, C, p_BC * rr, p_BD * rr,
.000, .000, C, p_CD * rr,
.000, .000, .000, 1.00
)
A_mono <- define_state(
cost_health = cost_A,
cost_drugs = cost_zido,
cost_total = discount(cost_health + cost_drugs, dr),
life_year = 1
)
B_mono <- define_state(
cost_health = cost_B,
cost_drugs = cost_zido,
cost_total = discount(cost_health + cost_drugs, dr),
life_year = 1
)
C_mono <- define_state(
cost_health = cost_C,
cost_drugs = cost_zido,
cost_total = discount(cost_health + cost_drugs, dr),
life_year = 1
)
D_mono <- define_state(
cost_health = 0,
cost_drugs = 0,
cost_total = discount(cost_health + cost_drugs, dr),
life_year = 0
)
A_comb <- define_state(
cost_health = cost_A,
cost_drugs = cost_zido + cost_lami,
cost_total = discount(cost_health + cost_drugs, dr),
life_year = 1
)
B_comb <- define_state(
cost_health = cost_B,
cost_drugs = cost_zido + cost_lami,
cost_total = discount(cost_health + cost_drugs, dr),
life_year = 1
)
C_comb <- define_state(
cost_health = cost_C,
cost_drugs = cost_zido + cost_lami,
cost_total = discount(cost_health + cost_drugs, dr),
life_year = 1
)
D_comb <- define_state(
cost_health = 0,
cost_drugs = 0,
cost_total = discount(cost_health + cost_drugs, dr),
life_year = 0
)
mod_mono <- define_strategy(
transition = mat_trans_mono,
A_mono,
B_mono,
C_mono,
D_mono
)
mod_comb <- define_strategy(
transition = mat_trans_comb,
A_comb,
B_comb,
C_comb,
D_comb
)
res_mod <- run_model(
mono = mod_mono,
comb = mod_comb,
parameters = param,
cycles = 20,
cost = cost_total,
effect = life_year
)
```
## Introduction
The objective of deterministic sensitivity analysis is to assess how model results are sensitive to parameter values. Parameter values are changed through upper and lower bounds, and the results are reported.
Sensitivity analysis is distinct from probabilistic uncertainty analysis: whereas in PSA the objective is to estimate the effect of global uncertainty on model results, in DSA the objective is to assess the sensitivity of results to variations of individual parameters. Both analyses are complementary.
## Define the analysis
This example uses the HIV drug model defined in `vignette("e-probabilistic", "heemod")`. See this vignette for an explanation of the model. Note that as in PSA, parameters need to be defined in `define_parameters()` in order to be modified in a DSA.
In this example we will study the sensitivity of cost to 4 parameters:
* `rr`, the relative risk associated with the new treatment.
* `cost_zido` and `cost_lami`, the drug costs.
* `dr`, the discount rate.
Upper and lower values for the parameters are given to `define_dsa()`.
```{r}
se <- define_dsa(
rr, .4, .6,
cost_zido, 1500, 3000,
cost_lami, 1500, 3000,
dr, .04, .08
)
```
We then run the sensitivity analysis with `run_dsa()`, using `res_mod` the result from `run_model()` as input.
```{r}
res_dsa <- run_dsa(
model = res_mod,
dsa = se
)
```
## Interpretation
All the results can be displayed in a table.
```{r}
res_dsa
```
Two distinct plot types are available. The basic plot (`type = "simple"`) displays cost variations for each model, around the base cost.
As expected `mono` model costs are not sensitive to `cost_lami`, since this drug was not given to this group. Similarly it is not sensitive to `rr`, because this parameters only modifies transition probabilities in the other model.
```{r, fig.width = 6, fig.align='center'}
plot(res_dsa,
strategy = "mono",
result = "cost",
type = "simple")
```
On the other hand the `comb` model cost is sensitive to all 4 parameters.
```{r, fig.width = 6, fig.align='center'}
plot(res_dsa,
strategy = "comb",
result = "cost",
type = "simple")
```
And its effectiveness is sensitive to `rr`
```{r, fig.width = 6, fig.align='center'}
plot(res_dsa,
strategy = "comb",
result = "effect",
type = "simple")
```
The difference plot (`type = "difference"`) displays the difference between the specified model `comb` and the reference model `mono`.
```{r, fig.width = 6, fig.align='center'}
plot(res_dsa,
strategy = "comb",
result = "cost",
type = "difference")
plot(res_dsa,
strategy = "comb",
result = "icer",
type = "difference")
```
It is also possible to leave the high and low parameter values off the plot:
```{r, fig.width = 6, fig.align='center'}
plot(res_dsa,
strategy = "comb",
result = "icer",
type = "difference",
limits_by_bars = FALSE)
```