diff --git a/articles/cea.html b/articles/cea.html index 94bd9455..599d5593 100644 --- a/articles/cea.html +++ b/articles/cea.html @@ -129,7 +129,7 @@
##    strategy_id patient_id transition_id strategy_name      age female grp_id
 ##          <num>      <int>         <num>        <char>    <num>  <int>  <num>
-## 1:           1          1             1           SOC 50.66353      1      1
-## 2:           1          1             2           SOC 50.66353      1      1
-## 3:           1          1             3           SOC 50.66353      1      1
-## 4:           1          1             4           SOC 50.66353      1      1
-## 5:           1          2             1           SOC 43.57896      0      2
-## 6:           1          2             2           SOC 43.57896      0      2
+## 1:           1          1             1           SOC 51.46850      0      2
+## 2:           1          1             2           SOC 51.46850      0      2
+## 3:           1          1             3           SOC 51.46850      0      2
+## 4:           1          1             4           SOC 51.46850      0      2
+## 5:           1          2             1           SOC 46.89669      1      1
+## 6:           1          2             2           SOC 46.89669      1      1
 ##    grp_name  from    to from_name to_name  trans
 ##      <char> <int> <int>    <char>  <char> <fctr>
-## 1:   Female     1     2   Stage 1 Stage 2      1
-## 2:   Female     1     3   Stage 1   Death      2
-## 3:   Female     2     1   Stage 2 Stage 1      3
-## 4:   Female     2     3   Stage 2   Death      4
-## 5:     Male     1     2   Stage 1 Stage 2      1
-## 6:     Male     1     3   Stage 1   Death      2
+## 1: Male 1 2 Stage 1 Stage 2 1 +## 2: Male 1 3 Stage 1 Death 2 +## 3: Male 2 1 Stage 2 Stage 1 3 +## 4: Male 2 3 Stage 2 Death 4 +## 5: Female 1 2 Stage 1 Stage 2 1 +## 6: Female 1 3 Stage 1 Death 2

The disease model is instantiated using the create_IndivCtstmTrans() generic method. Parameters for the PSA are, by default, drawn from the multivariate normal distribution of @@ -802,14 +802,14 @@

Simulating outcomes
 ictstm$sim_disease()
 head(ictstm$disprog_)
-
##    sample strategy_id patient_id grp_id  from    to final time_start time_stop
-##     <num>       <int>      <int>  <int> <num> <num> <int>      <num>     <num>
-## 1:      1           1          1      1     1     2     0   0.000000  1.011452
-## 2:      1           1          1      1     2     1     0   1.011452  2.081273
-## 3:      1           1          1      1     1     2     0   2.081273  4.933957
-## 4:      1           1          1      1     2     1     0   4.933957  5.866928
-## 5:      1           1          1      1     1     2     0   5.866928  9.472688
-## 6:      1           1          1      1     2     3     1   9.472688  9.533061
+
##    sample strategy_id patient_id grp_id  from    to final time_start  time_stop
+##     <num>       <int>      <int>  <int> <num> <num> <int>      <num>      <num>
+## 1:      1           1          1      2     1     2     0 0.00000000 0.03662113
+## 2:      1           1          1      2     2     1     0 0.03662113 2.31785245
+## 3:      1           1          1      2     1     3     1 2.31785245 5.70834878
+## 4:      1           1          2      1     1     3     1 0.00000000 0.43223806
+## 5:      1           1          3      2     1     2     0 0.00000000 7.59507169
+## 6:      1           1          3      2     2     1     0 7.59507169 7.85234308

The disease trajectory is summarized with $sim_stateprobs().

@@ -817,12 +817,12 @@ 

Simulating outcomeshead(ictstm$stateprobs_)

##    sample strategy_id grp_id state_id     t  prob
 ##     <num>       <int>  <int>    <num> <num> <num>
-## 1:      1           1      1        1     0 0.471
-## 2:      1           1      1        1     1 0.399
-## 3:      1           1      1        1     2 0.351
-## 4:      1           1      1        1     3 0.311
-## 5:      1           1      1        1     4 0.280
-## 6:      1           1      1        1     5 0.243
+## 1: 1 1 2 1 0 0.486 +## 2: 1 1 2 1 1 0.421 +## 3: 1 1 2 1 2 0.390 +## 4: 1 1 2 1 3 0.350 +## 5: 1 1 2 1 4 0.310 +## 6: 1 1 2 1 5 0.286

Finally, we compute QALYs and costs (using a discount rate of 3 percent).

@@ -831,24 +831,24 @@ 

Simulating outcomeshead(ictstm$qalys_)

##    sample strategy_id grp_id state_id    dr     qalys       lys
 ##     <num>       <int>  <int>    <num> <num>     <num>     <num>
-## 1:      1           1      1        1  0.03 3.2349269 3.6904414
-## 2:      1           1      1        2  0.03 0.2169966 0.7763719
-## 3:      1           1      2        1  0.03 4.2639193 4.8643276
-## 4:      1           1      2        2  0.03 0.2598320 0.9296284
-## 5:      1           2      1        1  0.03 3.5929910 4.0989251
-## 6:      1           2      1        2  0.03 0.1699955 0.6082108
+## 1: 1 1 1 1 0.03 3.2432982 4.0646498 +## 2: 1 1 1 2 0.03 0.7791066 0.7948613 +## 3: 1 1 2 1 0.03 3.7871868 4.7462759 +## 4: 1 1 2 2 0.03 1.0020059 1.0222679 +## 5: 1 2 1 1 0.03 3.4919892 4.3763207 +## 6: 1 2 1 2 0.03 0.5741133 0.5857227
 # Costs
 ictstm$sim_costs(dr = .03)
 head(ictstm$costs_)
##    sample strategy_id grp_id state_id    dr category     costs
 ##     <num>       <int>  <int>    <num> <num>   <char>     <num>
-## 1:      1           1      1        1  0.03    drugs 18452.207
-## 2:      1           1      1        2  0.03    drugs  3881.859
-## 3:      1           1      2        1  0.03    drugs 24321.638
-## 4:      1           1      2        2  0.03    drugs  4648.142
-## 5:      1           2      1        1  0.03    drugs 40989.251
-## 6:      1           2      1        2  0.03    drugs  6082.108
+## 1: 1 1 1 1 0.03 drugs 20323.249 +## 2: 1 1 1 2 0.03 drugs 3974.306 +## 3: 1 1 2 1 0.03 drugs 23731.379 +## 4: 1 1 2 2 0.03 drugs 5111.340 +## 5: 1 2 1 1 0.03 drugs 43763.207 +## 6: 1 2 1 2 0.03 drugs 5857.227
@@ -869,32 +869,32 @@

Decision analysis## $costs ## category dr sample strategy_id costs grp_id ## <char> <num> <num> <int> <num> <num> -## 1: drugs 0.03 1 1 51303.85 1 -## 2: drugs 0.03 1 2 108899.01 1 -## 3: drugs 0.03 2 1 48211.30 1 -## 4: drugs 0.03 2 2 91909.48 1 -## 5: drugs 0.03 3 1 57729.25 1 +## 1: drugs 0.03 1 1 53140.27 1 +## 2: drugs 0.03 1 2 108918.88 1 +## 3: drugs 0.03 2 1 52333.57 1 +## 4: drugs 0.03 2 2 87452.97 1 +## 5: drugs 0.03 3 1 51240.30 1 ## --- -## 5996: total 0.03 998 2 140888.55 1 -## 5997: total 0.03 999 1 62416.77 1 -## 5998: total 0.03 999 2 111458.69 1 -## 5999: total 0.03 1000 1 64518.25 1 -## 6000: total 0.03 1000 2 121805.07 1 +## 5996: total 0.03 998 2 118974.60 1 +## 5997: total 0.03 999 1 60504.59 1 +## 5998: total 0.03 999 2 131020.58 1 +## 5999: total 0.03 1000 1 69384.70 1 +## 6000: total 0.03 1000 2 117969.65 1 ## ## $qalys ## dr sample strategy_id qalys grp_id ## <num> <num> <int> <num> <num> -## 1: 0.03 1 1 7.975675 1 -## 2: 0.03 1 2 8.709084 1 -## 3: 0.03 2 1 6.912013 1 -## 4: 0.03 2 2 6.411368 1 -## 5: 0.03 3 1 7.654919 1 +## 1: 0.03 1 1 8.811598 1 +## 2: 0.03 1 2 8.945809 1 +## 3: 0.03 2 1 8.644085 1 +## 4: 0.03 2 2 7.223556 1 +## 5: 0.03 3 1 8.965867 1 ## --- -## 1996: 0.03 998 2 5.875016 1 -## 1997: 0.03 999 1 6.467773 1 -## 1998: 0.03 999 2 6.418552 1 -## 1999: 0.03 1000 1 7.277871 1 -## 2000: 0.03 1000 2 7.448502 1 +## 1996: 0.03 998 2 7.982083 1 +## 1997: 0.03 999 1 4.940269 1 +## 1998: 0.03 999 2 5.360002 1 +## 1999: 0.03 1000 1 7.518317 1 +## 2000: 0.03 1000 2 7.003058 1 ## ## attr(,"class") ## [1] "ce" diff --git a/articles/intro_files/figure-html/ceac_plot-1.png b/articles/intro_files/figure-html/ceac_plot-1.png index da0af2f3..cf96d090 100644 Binary files a/articles/intro_files/figure-html/ceac_plot-1.png and b/articles/intro_files/figure-html/ceac_plot-1.png differ diff --git a/articles/markov-cohort.html b/articles/markov-cohort.html index 358ef754..5996b5e5 100644 --- a/articles/markov-cohort.html +++ b/articles/markov-cohort.html @@ -129,7 +129,7 @@
##    sample strategy_id patient_id grp_id state_id    dr    qalys      lys
 ##     <num>       <int>      <int>  <int>    <int> <num>    <num>    <num>
-## 1:      1           1          1      1        1     0 2.516703 2.516703
-## 2:      1           1          1      1        2     0 1.792060 1.792060
-## 3:      1           1          1      1        3     0 3.549131 3.549131
-## 4:      1           2          1      1        1     0 3.607568 3.607568
-## 5:      1           2          1      1        2     0 1.840735 1.840735
-## 6:      1           2          1      1        3     0 3.533521 3.533521
+## 1: 1 1 1 1 1 0 2.635917 2.635917 +## 2: 1 1 1 1 2 0 1.832230 1.832230 +## 3: 1 1 1 1 3 0 3.588779 3.588779 +## 4: 1 2 1 1 1 0 3.586525 3.586525 +## 5: 1 2 1 1 2 0 1.881446 1.881446 +## 6: 1 2 1 1 3 0 3.572148 3.572148
 econmod$sim_costs(dr = 0.06, integrate_method = "riemann_right")
 head(econmod$costs_)
##    sample strategy_id patient_id grp_id state_id    dr category    costs
 ##     <num>       <int>      <int>  <int>    <int> <num>   <char>    <num>
-## 1:      1           1          1      1        1  0.06     drug 4712.387
-## 2:      1           1          1      1        2  0.06     drug 3101.771
-## 3:      1           1          1      1        3  0.06     drug 5204.037
-## 4:      1           2          1      1        1  0.06     drug 9866.589
-## 5:      1           2          1      1        2  0.06     drug 3456.348
-## 6:      1           2          1      1        3  0.06     drug 5039.832
+## 1: 1 1 1 1 1 0.06 drug 4906.907 +## 2: 1 1 1 1 2 0.06 drug 3152.413 +## 3: 1 1 1 1 3 0.06 drug 5207.198 +## 4: 1 2 1 1 1 0.06 drug 9716.158 +## 5: 1 2 1 1 2 0.06 drug 3590.578 +## 6: 1 2 1 1 3 0.06 drug 5090.461

@@ -500,14 +500,14 @@

Decision analysisformat(icer(cea_pw_out))
##              Outcome                       2
 ##               <fctr>                  <char>
-## 1: Incremental QALYs       0.92 (0.54, 1.21)
-## 2: Incremental costs   5,884 (2,898, 10,013)
-## 3:   Incremental NMB 40,108 (22,334, 54,761)
-## 4:              ICER                   6,396
+## 1: Incremental QALYs 0.93 (0.58, 1.21) +## 2: Incremental costs 5,856 (2,759, 10,364) +## 3: Incremental NMB 40,785 (23,744, 54,709) +## 4: ICER 6,277

A cost-effectiveness acceptability curve shows that the probability that combination therapy is more cost-effective than monotherapy increases quickly with the willingness to pay (WTP) for a QALY. At -$10,000, the probability is 0.949 and approaches 1 at slightly higher +$10,000, the probability is 0.942 and approaches 1 at slightly higher WTP values.

 plot_ceac(cea_pw_out, labels = labs)
diff --git a/articles/markov-cohort_files/figure-html/ceac-1.png b/articles/markov-cohort_files/figure-html/ceac-1.png index 7c66a383..6f440d88 100644 Binary files a/articles/markov-cohort_files/figure-html/ceac-1.png and b/articles/markov-cohort_files/figure-html/ceac-1.png differ diff --git a/articles/markov-cohort_files/figure-html/simStateprobsPlot-1.png b/articles/markov-cohort_files/figure-html/simStateprobsPlot-1.png index e8a94d1d..14d9f0c7 100644 Binary files a/articles/markov-cohort_files/figure-html/simStateprobsPlot-1.png and b/articles/markov-cohort_files/figure-html/simStateprobsPlot-1.png differ diff --git a/articles/markov-inhomogeneous-cohort.html b/articles/markov-inhomogeneous-cohort.html index 18f4d87a..41ad8a08 100644 --- a/articles/markov-inhomogeneous-cohort.html +++ b/articles/markov-inhomogeneous-cohort.html @@ -130,7 +130,7 @@
##    Discount rate           Outcome  Standard prosthesis       New prosthesis
 ##            <num>            <fctr>               <char>               <char>
-## 1:         0.015             QALYs 14.62 (13.52, 15.53) 14.67 (13.56, 15.59)
+## 1:         0.015             QALYs 14.63 (13.57, 15.65) 14.68 (13.60, 15.71)
 ## 2:         0.060 Costs: prosthesis       394 (394, 394)       579 (579, 579)
-## 3:         0.060    Costs: medical        117 (53, 219)          33 (10, 75)
-## 4:         0.060      Costs: total       511 (447, 613)       612 (589, 654)
+## 3: 0.060 Costs: medical 117 (52, 215) 34 (10, 81) +## 4: 0.060 Costs: total 511 (446, 609) 613 (589, 660)

We can then compute incremental cost-effectiveness ratios for each subgroup. There is considerable variation which is not unexpected since the the revision rate for prostheses (rr) depends on @@ -716,30 +716,30 @@

Subgroup analysisicer(cea_pw_out) %>% format(pivot_from = "outcome")
## Key: <Group, Strategy>
-##     Group Strategy Incremental QALYs Incremental costs      Incremental NMB
-##     <int>    <int>            <char>            <char>               <char>
-##  1:     1        2 0.07 (0.02, 0.12)     67 (-37, 136)   3,468 (923, 6,182)
-##  2:     2        2 0.04 (0.01, 0.08)     100 (22, 150)   2,085 (532, 3,793)
-##  3:     3        2 0.03 (0.01, 0.05)     126 (72, 160)   1,179 (257, 2,237)
-##  4:     4        2 0.02 (0.00, 0.03)    146 (107, 169)      607 (83, 1,244)
-##  5:     5        2 0.01 (0.00, 0.02)    160 (133, 175)       264 (-23, 640)
-##  6:     6        2 0.11 (0.04, 0.20)    -31 (-251, 90) 5,696 (1,830, 9,971)
-##  7:     7        2 0.07 (0.02, 0.12)    33 (-119, 118) 3,408 (1,076, 6,010)
-##  8:     8        2 0.04 (0.01, 0.07)     81 (-17, 140)   1,937 (595, 3,530)
-##  9:     9        2 0.02 (0.01, 0.04)     116 (50, 156)   1,034 (271, 1,960)
-## 10:    10        2 0.01 (0.00, 0.02)     141 (99, 167)      502 (73, 1,036)
+##     Group Strategy Incremental QALYs Incremental costs       Incremental NMB
+##     <int>    <int>            <char>            <char>                <char>
+##  1:     1        2 0.07 (0.03, 0.13)     69 (-47, 138)  3,411 (1,139, 6,218)
+##  2:     2        2 0.04 (0.02, 0.08)     102 (18, 152)    2,048 (639, 3,836)
+##  3:     3        2 0.03 (0.01, 0.05)     127 (67, 162)    1,155 (326, 2,257)
+##  4:     4        2 0.01 (0.01, 0.03)    146 (106, 170)      592 (110, 1,229)
+##  5:     5        2 0.01 (0.00, 0.02)    160 (135, 176)        255 (-17, 630)
+##  6:     6        2 0.11 (0.04, 0.20)    -27 (-246, 97) 5,590 (2,055, 10,227)
+##  7:     7        2 0.07 (0.03, 0.12)    35 (-128, 125)  3,341 (1,217, 6,241)
+##  8:     8        2 0.04 (0.02, 0.07)     83 (-33, 145)    1,896 (663, 3,681)
+##  9:     9        2 0.02 (0.01, 0.04)     117 (39, 160)    1,008 (310, 2,039)
+## 10:    10        2 0.01 (0.00, 0.02)     142 (89, 169)       486 (92, 1,077)
 ##          ICER
 ##        <char>
-##  1:       946
-##  2:     2,293
-##  3:     4,833
-##  4:     9,676
-##  5:    18,830
+##  1:       992
+##  2:     2,369
+##  3:     4,965
+##  4:     9,917
+##  5:    19,287
 ##  6: Dominates
-##  7:       474
-##  8:     2,008
-##  9:     5,052
-## 10:    10,975
+## 7: 523 +## 8: 2,096 +## 9: 5,216 +## 10: 11,291

Overall @@ -757,10 +757,10 @@

Overall format(digits_qalys = 3)

##              Outcome       New prosthesis
 ##               <fctr>               <char>
-## 1: Incremental QALYs 0.028 (0.009, 0.050)
-## 2: Incremental costs        118 (52, 156)
-## 3:   Incremental NMB   1,303 (325, 2,404)
-## 4:              ICER                4,147
+## 1: Incremental QALYs 0.028 (0.011, 0.051) +## 2: Incremental costs 119 (48, 159) +## 3: Incremental NMB 1,276 (394, 2,479) +## 4: ICER 4,270
@@ -973,15 +973,15 @@

Transformed parameters 0, 0, 0, 0, 1 ) tpmat[1, ]

-
##    s1_s1     s1_s2 s1_s3 s1_s4        s1_s5 s2_s1     s2_s2        s2_s3 s2_s4
-##    <num>     <num> <num> <num>        <num> <num>     <num>        <num> <num>
-## 1:     0 0.9998976     0     0 0.0001023922     0 0.9927472 0.0005527648     0
-##     s2_s5 s3_s1 s3_s2 s3_s3     s3_s4       s3_s5 s4_s1 s4_s2      s4_s3
-##     <num> <num> <num> <num>     <num>       <num> <num> <num>      <num>
-## 1: 0.0067     0     0     0 0.9931976 0.006802392     0     0 0.04465195
+
##    s1_s1     s1_s2 s1_s3 s1_s4      s1_s5 s2_s1     s2_s2        s2_s3 s2_s4
+##    <num>     <num> <num> <num>      <num> <num>     <num>        <num> <num>
+## 1:     0 0.9784834     0     0 0.02151661     0 0.9927689 0.0005311486     0
+##     s2_s5 s3_s1 s3_s2 s3_s3     s3_s4      s3_s5 s4_s1 s4_s2     s4_s3
+##     <num> <num> <num> <num>     <num>      <num> <num> <num>     <num>
+## 1: 0.0067     0     0     0 0.9717834 0.02821661     0     0 0.1089974
 ##        s4_s4  s4_s5 s5_s1 s5_s2 s5_s3 s5_s4 s5_s5
 ##        <num>  <num> <num> <num> <num> <num> <num>
-## 1: 0.9486481 0.0067     0     0     0     0     1
+## 1: 0.8843026 0.0067 0 0 0 0 1

Finally, we combine the ID variables and the transition probability matrices into a single object.

@@ -1005,11 +1005,11 @@ 

Simulationformat()

##    Discount rate           Outcome  Standard prosthesis       New prosthesis
 ##            <num>            <fctr>               <char>               <char>
-## 1:         0.015             QALYs 14.63 (13.53, 15.65) 14.67 (13.56, 15.70)
+## 1:         0.015             QALYs 14.62 (13.44, 15.67) 14.67 (13.48, 15.73)
 ## 2:         0.060 Costs: prosthesis       394 (394, 394)       579 (579, 579)
-## 3:         0.060    Costs: medical        119 (55, 219)          33 (10, 84)
-## 4:         0.060      Costs: total       513 (449, 613)       612 (589, 663)
-

However, time to construct the transition model was 2.5 times faster. +## 3: 0.060 Costs: medical 120 (52, 231) 33 (10, 75) +## 4: 0.060 Costs: total 514 (446, 625) 612 (589, 654) +

However, time to construct the transition model was 2.4 times faster. Although both are quite fast (time in the table is in seconds), this difference would become more pronounced as the number of parameter samples, treatment strategies, patients, and/or distinct time periods @@ -1045,13 +1045,13 @@

Simulation -3.292 +3.205 -0.193 +0.2 -3.389 +3.305 @@ -1059,13 +1059,13 @@

Simulation -1.399 +1.393 -0.513 +0.5 -1.380 +1.355 diff --git a/articles/markov-inhomogeneous-cohort_files/figure-html/simStateprobsPlot-1.png b/articles/markov-inhomogeneous-cohort_files/figure-html/simStateprobsPlot-1.png index 089f0bce..79e350b2 100644 Binary files a/articles/markov-inhomogeneous-cohort_files/figure-html/simStateprobsPlot-1.png and b/articles/markov-inhomogeneous-cohort_files/figure-html/simStateprobsPlot-1.png differ diff --git a/articles/markov-inhomogeneous-indiv.html b/articles/markov-inhomogeneous-indiv.html index f3130104..9a07ab18 100644 --- a/articles/markov-inhomogeneous-indiv.html +++ b/articles/markov-inhomogeneous-indiv.html @@ -131,7 +131,7 @@

Time inhomogeneous Markov individual-level models

-

2024-02-10

+

2024-02-11

Source:
vignettes/markov-inhomogeneous-indiv.Rmd @@ -581,46 +581,46 @@

Multi-state model
 summary(transmod_coef)
-
##                      param        mean          sd        2.5%       97.5%
-##                     <char>       <num>       <num>       <num>       <num>
-##  1:       log_omrPTHR_cons -4.20854937 0.769628358 -5.76168255 -2.94767336
-##  2:          log_mr_time_0 -5.00564775 0.000000000 -5.00564775 -5.00564775
-##  3:          log_mr_time_5 -3.94765018 0.000000000 -3.94765018 -3.94765018
-##  4:         log_mr_time_15 -2.92807363 0.000000000 -2.92807363 -2.92807363
-##  5:         log_mr_time_25 -1.86562132 0.000000000 -1.86562132 -1.86562132
-##  6:      log_ttrrPTHR_cons  0.69314718 0.000000000  0.69314718  0.69314718
-##  7:  log_mr_omrPTHR_time_0 -3.77419372 0.502085305 -4.62067908 -2.82748199
-##  8:  log_mr_omrPTHR_time_5 -3.30876985 0.329731223 -3.79663461 -2.63440504
-##  9: log_mr_omrPTHR_time_15 -2.63511939 0.179780951 -2.87092999 -2.24467778
-## 10: log_mr_omrPTHR_time_25 -1.75046864 0.079144030 -1.84550058 -1.57377302
-## 11:          rr_shape_cons  0.37674026 0.049029177  0.28383966  0.47821117
-## 12:          rr_scale_cons -5.49269695 0.215048719 -5.88806174 -5.06679072
-## 13:           rr_scale_age -0.03661308 0.005178508 -0.04719502 -0.02613426
-## 14:          rr_scale_male  0.75949554 0.111347013  0.55008997  0.97994082
-## 15:           rr_scale_np1 -1.35395568 0.397577367 -2.12267509 -0.54385547
-## 16:           log_rrr_cons -3.34604850 0.525726697 -4.43778978 -2.40840120
+
##                      param        mean         sd        2.5%       97.5%
+##                     <char>       <num>      <num>       <num>       <num>
+##  1:       log_omrPTHR_cons -4.15928533 0.80187587 -6.00448991 -2.89731992
+##  2:          log_mr_time_0 -5.00564775 0.00000000 -5.00564775 -5.00564775
+##  3:          log_mr_time_5 -3.94765018 0.00000000 -3.94765018 -3.94765018
+##  4:         log_mr_time_15 -2.92807363 0.00000000 -2.92807363 -2.92807363
+##  5:         log_mr_time_25 -1.86562132 0.00000000 -1.86562132 -1.86562132
+##  6:      log_ttrrPTHR_cons  0.69314718 0.00000000  0.69314718  0.69314718
+##  7:  log_mr_omrPTHR_time_0 -3.73487676 0.50742315 -4.69207087 -2.78269602
+##  8:  log_mr_omrPTHR_time_5 -3.28260989 0.33128812 -3.82732859 -2.59732805
+##  9: log_mr_omrPTHR_time_15 -2.62136052 0.17900219 -2.88298069 -2.21940665
+## 10: log_mr_omrPTHR_time_25 -1.74477637 0.07777364 -1.84980587 -1.56076725
+## 11:          rr_shape_cons  0.37408141 0.04417159  0.29728783  0.45321402
+## 12:          rr_scale_cons -5.49129351 0.20292983 -5.88147118 -5.12320765
+## 13:           rr_scale_age -0.03664679 0.00504719 -0.04621155 -0.02716836
+## 14:          rr_scale_male  0.76408610 0.11371270  0.55668887  0.98231746
+## 15:           rr_scale_np1 -1.37312553 0.38143367 -2.10721241 -0.60024772
+## 16:           log_rrr_cons -3.35450357 0.53554700 -4.44843134 -2.48397327

It is also helpful to take a look at a few of the sampled coefficient data tables.

 head(transmod_coef$log_omrPTHR)
##         cons
 ##        <num>
-## 1: -3.106582
-## 2: -4.514592
-## 3: -2.945753
-## 4: -3.305822
-## 5: -4.605754
-## 6: -3.628302
+## 1: -3.411590 +## 2: -4.303414 +## 3: -4.168389 +## 4: -4.870063 +## 5: -4.014536 +## 6: -4.502533
 head(transmod_coef$rr_scale)
##         cons         age      male        np1
 ##        <num>       <num>     <num>      <num>
-## 1: -5.171666 -0.04119477 0.7637201 -1.4904880
-## 2: -5.451994 -0.03844263 0.6633618 -1.2769065
-## 3: -5.378919 -0.04359905 1.0404490 -1.3530538
-## 4: -5.762656 -0.03628730 1.0125855 -1.3551783
-## 5: -4.904196 -0.04950145 0.6481541 -1.4308863
-## 6: -5.494808 -0.03677342 0.7661005 -0.2864631
+## 1: -5.485059 -0.04167433 0.8650169 -1.5566642 +## 2: -5.328609 -0.04400885 0.8981182 -1.4424299 +## 3: -5.608818 -0.03818738 0.8393678 -1.5624932 +## 4: -5.567563 -0.03424712 0.6938261 -1.5819033 +## 5: -5.466357 -0.03934928 0.9023543 -0.5785861 +## 6: -5.602355 -0.03126114 0.6852290 -1.0493641

In addition to the coefficients, a complete parameterization of a transition model requires specification of the survival distributions and potentially auxiliary information (e.g., the times at which rates @@ -815,17 +815,25 @@

Disease progressioneconmod$sim_disease(max_t = 60, max_age = 120) proc.time() - ptm
##    user  system elapsed 
-##   1.698   0.076   1.774
+## 1.666 0.100 1.767
 head(econmod$disprog_)
-
##    sample strategy_id patient_id grp_id  from    to final time_start  time_stop
-##     <num>       <int>      <int>  <int> <num> <num> <int>      <num>      <num>
-## 1:      1           1          1      1     1     2     0  0.0000000  0.3312046
-## 2:      1           1          1      1     2     5     1  0.3312046 14.8661088
-## 3:      1           1          2      1     1     2     0  0.0000000  0.4570236
-## 4:      1           1          2      1     2     5     1  0.4570236 19.9447510
-## 5:      1           1          3      1     1     2     0  0.0000000  0.1319474
-## 6:      1           1          3      1     2     5     1  0.1319474 37.7205261
+
##    sample strategy_id patient_id grp_id  from    to final time_start
+##     <num>       <int>      <int>  <int> <num> <num> <int>      <num>
+## 1:      1           1          1      1     1     2     0 0.00000000
+## 2:      1           1          1      1     2     5     1 0.06989725
+## 3:      1           1          2      1     1     2     0 0.00000000
+## 4:      1           1          2      1     2     5     1 0.27152781
+## 5:      1           1          3      1     1     2     0 0.00000000
+## 6:      1           1          3      1     2     3     0 0.01568356
+##      time_stop
+##          <num>
+## 1:  0.06989725
+## 2: 18.99991466
+## 3:  0.27152781
+## 4: 28.87905653
+## 5:  0.01568356
+## 6: 20.97806345

The simulated patient trajectories can be summarized by computing the probability of being in each health state over time (by averaging across the simulated patients). Here, we will compute state occupancy @@ -862,10 +870,10 @@

Costs and QALYs format()
##    Discount rate        Outcome  Standard prosthesis       New prosthesis
 ##            <num>         <fctr>               <char>               <char>
-## 1:         0.015          QALYs 15.45 (14.17, 16.49) 15.50 (14.32, 16.53)
+## 1:         0.015          QALYs 15.38 (14.24, 16.46) 15.42 (14.23, 16.49)
 ## 2:         0.060    Costs: Drug       394 (394, 394)       579 (579, 579)
-## 3:         0.060 Costs: Medical        121 (49, 240)          34 (6, 101)
-## 4:         0.060   Costs: total       515 (443, 634)       613 (585, 680)
+## 3: 0.060 Costs: Medical 120 (50, 236) 33 (6, 83) +## 4: 0.060 Costs: total 514 (444, 630) 612 (585, 662) @@ -882,10 +890,10 @@

Decision analysisformat(digits_qalys = 3)
##              Outcome          New prosthesis
 ##               <fctr>                  <char>
-## 1: Incremental QALYs   0.054 (-0.497, 0.639)
-## 2: Incremental costs           98 (-18, 163)
-## 3:   Incremental NMB 2,627 (-24,977, 31,864)
-## 4:              ICER                   1,790
+## 1: Incremental QALYs 0.041 (-0.514, 0.618) +## 2: Incremental costs 97 (6, 161) +## 3: Incremental NMB 1,976 (-25,751, 30,853) +## 4: ICER 2,347 diff --git a/articles/markov-inhomogeneous-indiv_files/figure-html/unnamed-chunk-31-1.png b/articles/markov-inhomogeneous-indiv_files/figure-html/unnamed-chunk-31-1.png index e74e6c6e..2b561320 100644 Binary files a/articles/markov-inhomogeneous-indiv_files/figure-html/unnamed-chunk-31-1.png and b/articles/markov-inhomogeneous-indiv_files/figure-html/unnamed-chunk-31-1.png differ diff --git a/articles/mlogit.html b/articles/mlogit.html index eeff6d25..b5fad595 100644 --- a/articles/mlogit.html +++ b/articles/mlogit.html @@ -130,7 +130,7 @@

Markov models with multinomial logistic regression

-

2024-02-10

+

2024-02-11

Source: vignettes/mlogit.Rmd @@ -229,12 +229,12 @@

An example 3-state modelhead(patients)
##    patient_id      age female grp_id
 ##         <int>    <num>  <int>  <int>
-## 1:         12 62.55323      1      1
-## 2:       9645 30.36514      0      2
-## 3:       2004 29.63812      0      3
-## 4:       7699 38.35054      1      4
-## 5:       2491 28.35680      1      5
-## 6:       7616 55.50041      1      6
+## 1: 9031 30.93736 1 1 +## 2: 940 60.31440 1 2 +## 3: 168 84.85698 0 3 +## 4: 4707 79.34795 1 4 +## 5: 5768 40.06818 1 5 +## 6: 1022 84.82807 0 6

To perform the cost-effectiveness analysis, each patient is simulated twice, once with the reference treatment and once with the intervention. The non-death states use for simulating costs and quality-adjusted diff --git a/articles/mlogit_files/figure-html/icerHeterogeneity-1.png b/articles/mlogit_files/figure-html/icerHeterogeneity-1.png index de2b63e7..70f1f11c 100644 Binary files a/articles/mlogit_files/figure-html/icerHeterogeneity-1.png and b/articles/mlogit_files/figure-html/icerHeterogeneity-1.png differ diff --git a/articles/mlogit_files/figure-html/stateprobs-1.png b/articles/mlogit_files/figure-html/stateprobs-1.png index 4e7efca5..c4201442 100644 Binary files a/articles/mlogit_files/figure-html/stateprobs-1.png and b/articles/mlogit_files/figure-html/stateprobs-1.png differ diff --git a/articles/mstate.html b/articles/mstate.html index 452d0dc1..4cc7b26d 100644 --- a/articles/mstate.html +++ b/articles/mstate.html @@ -129,7 +129,7 @@

##    strategy_id patient_id strategy_name      age female
 ##          <num>      <int>        <char>    <num>  <int>
-## 1:           1          1           SOC 38.38256      1
-## 2:           1          2           SOC 44.20986      0
-## 3:           1          3           SOC 49.25665      0
-## 4:           1          4           SOC 43.43079      1
-## 5:           1          5           SOC 47.04979      0
-## 6:           1          6           SOC 32.53914      1
+## 1: 1 1 SOC 52.50953 0 +## 2: 1 2 SOC 48.09793 1 +## 3: 1 3 SOC 52.93048 0 +## 4: 1 4 SOC 32.35003 1 +## 5: 1 5 SOC 38.16166 1 +## 6: 1 6 SOC 47.37747 1

“Clock reset” and “clock forward” transition models are created by combining the fitted models and input data with the transition matrix, desired number of PSA samples, the timescale of the model, and the @@ -455,12 +455,12 @@

Disease progressionhead(econmod_cr$disprog_)
##    sample strategy_id patient_id grp_id  from    to final time_start time_stop
 ##     <num>       <int>      <int>  <int> <num> <num> <int>      <num>     <num>
-## 1:      1           1          1      1     1     2     0  0.0000000 0.6662380
-## 2:      1           1          1      1     2     1     0  0.6662380 0.7343886
-## 3:      1           1          1      1     1     2     0  0.7343886 1.7371309
-## 4:      1           1          1      1     2     3     1  1.7371309 1.9450028
-## 5:      1           1          2      1     1     2     0  0.0000000 0.3036953
-## 6:      1           1          2      1     2     1     0  0.3036953 2.5441720
+## 1: 1 1 1 1 1 3 1 0.000000 11.297346 +## 2: 1 1 2 1 1 2 0 0.000000 16.220564 +## 3: 1 1 2 1 2 3 1 16.220564 16.221202 +## 4: 1 1 3 1 1 2 0 0.000000 5.431493 +## 5: 1 1 3 1 2 3 1 5.431493 5.764479 +## 6: 1 1 4 1 1 2 0 0.000000 16.201358
 # "Clock forward"
 econmod_cf$sim_disease()
@@ -521,14 +521,14 @@

Costs and QALYs
 econmod_cr$sim_qalys(dr = c(0,.03))
 head(econmod_cr$qalys_)
-
##    sample strategy_id grp_id state_id    dr    qalys      lys
-##     <num>       <int>  <int>    <num> <num>    <num>    <num>
-## 1:      1           1      1        1     0 3.898276 5.897366
-## 2:      1           1      1        2     0 1.240132 1.344879
-## 3:      1           2      1        1     0 5.703649 8.628560
-## 4:      1           2      1        2     0 1.169980 1.268801
-## 5:      2           1      1        1     0 4.504802 5.412631
-## 6:      2           1      1        2     0 1.369986 1.380590
+
##    sample strategy_id grp_id state_id    dr     qalys       lys
+##     <num>       <int>  <int>    <num> <num>     <num>     <num>
+## 1:      1           1      1        1     0 4.9464510 6.7150039
+## 2:      1           1      1        2     0 1.1589932 1.4158811
+## 3:      1           2      1        1     0 5.3445037 7.2553764
+## 4:      1           2      1        2     0 0.7193075 0.8787402
+## 5:      2           1      1        1     0 3.1095818 6.1713151
+## 6:      2           1      1        2     0 1.4818925 1.5773928

Let’s compute means (across the PSA samples) by treatment strategy and health state to see how much each health state contributes to total QALYs.

@@ -551,12 +551,12 @@

Costs and QALYshead(econmod_cr$costs_)
##    sample strategy_id grp_id state_id    dr category     costs
 ##     <num>       <int>  <int>    <num> <num>   <char>     <num>
-## 1:      1           1      1        1  0.03     Drug 24060.637
-## 2:      1           1      1        2  0.03     Drug  5479.239
-## 3:      1           2      1        1  0.03     Drug 65617.579
-## 4:      1           2      1        2  0.03     Drug 10026.010
-## 5:      2           1      1        1  0.03     Drug 22490.294
-## 6:      2           1      1        2  0.03     Drug  5597.842
+## 1: 1 1 1 1 0.03 Drug 26453.993 +## 2: 1 1 1 2 0.03 Drug 5664.916 +## 3: 1 2 1 1 0.03 Drug 57281.566 +## 4: 1 2 1 2 0.03 Drug 7120.419 +## 5: 2 1 1 1 0.03 Drug 24662.169 +## 6: 2 1 1 2 0.03 Drug 6340.108 @@ -576,11 +576,11 @@

Decision analysisformat(summary(ce_sim, labels = labs))
##    Discount rate        Outcome                     SOC                     New
 ##            <num>         <fctr>                  <char>                  <char>
-## 1:          0.00          QALYs       5.11 (2.61, 7.40)       6.09 (2.86, 9.04)
-## 2:          0.03          QALYs       4.12 (2.12, 5.88)       4.71 (2.23, 6.84)
-## 3:          0.03    Costs: Drug 30,094 (25,469, 35,301) 70,070 (58,227, 81,736)
-## 4:          0.03 Costs: Medical    6,717 (5,679, 7,901)    7,529 (6,273, 8,764)
-## 5:          0.03   Costs: total 36,811 (31,186, 43,294) 77,599 (64,435, 90,427)
+## 1: 0.00 QALYs 5.09 (2.77, 7.33) 6.04 (2.97, 8.91) +## 2: 0.03 QALYs 4.10 (2.25, 5.79) 4.67 (2.33, 6.72) +## 3: 0.03 Costs: Drug 30,106 (25,274, 35,156) 69,944 (58,826, 81,977) +## 4: 0.03 Costs: Medical 6,722 (5,658, 7,869) 7,521 (6,366, 8,796) +## 5: 0.03 Costs: total 36,828 (30,913, 43,025) 77,465 (65,252, 90,847)
 cea_out <- cea(ce_sim, dr_qalys = .03, dr_costs = .03)
 cea_pw_out <- cea_pw(ce_sim, comparator = 1, dr_qalys = .03, dr_costs = .03)
diff --git a/articles/mstate_files/figure-html/qalys_plot-1.png b/articles/mstate_files/figure-html/qalys_plot-1.png index 8ae28cc6..3b54dd8e 100644 Binary files a/articles/mstate_files/figure-html/qalys_plot-1.png and b/articles/mstate_files/figure-html/qalys_plot-1.png differ diff --git a/articles/mstate_files/figure-html/stprobs_by_strategy_plot-1.png b/articles/mstate_files/figure-html/stprobs_by_strategy_plot-1.png index 77444e9b..ee8a036c 100644 Binary files a/articles/mstate_files/figure-html/stprobs_by_strategy_plot-1.png and b/articles/mstate_files/figure-html/stprobs_by_strategy_plot-1.png differ diff --git a/articles/mstate_files/figure-html/stprobs_by_timescale_plot-1.png b/articles/mstate_files/figure-html/stprobs_by_timescale_plot-1.png index c9fd4ec8..1b7819c6 100644 Binary files a/articles/mstate_files/figure-html/stprobs_by_timescale_plot-1.png and b/articles/mstate_files/figure-html/stprobs_by_timescale_plot-1.png differ diff --git a/articles/psm.html b/articles/psm.html index 048ee4ea..99d10c55 100644 --- a/articles/psm.html +++ b/articles/psm.html @@ -129,7 +129,7 @@