diff --git a/docs/404.html b/docs/404.html index f7f833e3..167d7d5c 100644 --- a/docs/404.html +++ b/docs/404.html @@ -81,7 +81,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/articles/cea.html b/docs/articles/cea.html index 03639df7..2e420c06 100644 --- a/docs/articles/cea.html +++ b/docs/articles/cea.html @@ -37,7 +37,7 @@ hesim - 0.4.0 + 0.4.1 @@ -116,7 +116,7 @@ @@ -116,7 +116,7 @@ diff --git a/docs/articles/intro.html b/docs/articles/intro.html index dbdfa0ad..6a21c36b 100644 --- a/docs/articles/intro.html +++ b/docs/articles/intro.html @@ -37,7 +37,7 @@ hesim - 0.4.0 + 0.4.1 @@ -117,7 +117,7 @@

Introduction to hesim

-

2020-09-28

+

2020-10-01

Source: vignettes/intro.Rmd @@ -209,17 +209,17 @@

## ## $patients ## patient_id age female -## 1: 1 33.91472 1 -## 2: 2 41.94600 0 -## 3: 3 45.42755 0 -## 4: 4 44.56844 1 -## 5: 5 42.86476 0 +## 1: 1 49.24836 1 +## 2: 2 47.28333 1 +## 3: 3 47.50857 0 +## 4: 4 47.48207 0 +## 5: 5 45.82377 1 ## --- -## 996: 996 48.38203 1 -## 997: 997 48.78798 0 -## 998: 998 51.23208 1 -## 999: 999 48.98244 1 -## 1000: 1000 41.67889 0 +## 996: 996 38.87299 1 +## 997: 997 52.21110 0 +## 998: 998 45.31234 0 +## 999: 999 43.84164 0 +## 1000: 1000 47.86475 1 ## ## $states ## state_id state_name @@ -485,12 +485,12 @@

by = c("strategies", "patients", "transitions")) head(transmod_data)
##    strategy_id patient_id transition_id      age female from to from_name
-## 1:           1          1             1 33.91472      1    1  2   Healthy
-## 2:           1          1             2 33.91472      1    1  3   Healthy
-## 3:           1          1             3 33.91472      1    2  1      Sick
-## 4:           1          1             4 33.91472      1    2  3      Sick
-## 5:           1          2             1 41.94600      0    1  2   Healthy
-## 6:           1          2             2 41.94600      0    1  3   Healthy
+## 1:           1          1             1 49.24836      1    1  2   Healthy
+## 2:           1          1             2 49.24836      1    1  3   Healthy
+## 3:           1          1             3 49.24836      1    2  1      Sick
+## 4:           1          1             4 49.24836      1    2  3      Sick
+## 5:           1          2             1 47.28333      1    1  2   Healthy
+## 6:           1          2             2 47.28333      1    1  3   Healthy
 ##    to_name trans
 ## 1:    Sick     1
 ## 2:    Dead     2
@@ -597,44 +597,44 @@ 

We illustrate with the iCTSTM. First we simulate disease progression for each patient.

ictstm$sim_disease()
 head(ictstm$disprog_)
-
##    sample strategy_id patient_id grp_id from to final time_start time_stop
-## 1:      1           1          1      1    1  2     0   0.000000  1.403569
-## 2:      1           1          1      1    2  1     0   1.403569  1.885190
-## 3:      1           1          1      1    1  2     0   1.885190 16.351995
-## 4:      1           1          1      1    2  1     0  16.351995 16.620082
-## 5:      1           1          1      1    1  2     0  16.620082 19.219815
-## 6:      1           1          1      1    2  1     0  19.219815 22.499800
+
##    sample strategy_id patient_id grp_id from to final time_start  time_stop
+## 1:      1           1          1      1    1  2     0  0.0000000  6.2457079
+## 2:      1           1          1      1    2  3     1  6.2457079  7.8863905
+## 3:      1           1          2      1    1  2     0  0.0000000  0.8732046
+## 4:      1           1          2      1    2  1     0  0.8732046  2.5136783
+## 5:      1           1          2      1    1  2     0  2.5136783 12.1355106
+## 6:      1           1          2      1    2  3     1 12.1355106 12.1551066

The disease trajectory can be summarized with $sim_stateprobs().

ictstm$sim_stateprobs(t = c(0:10))
 head(ictstm$stateprobs_)
##    sample strategy_id grp_id state_id t  prob
 ## 1:      1           1      1        1 0 1.000
-## 2:      1           1      1        1 1 0.874
-## 3:      1           1      1        1 2 0.772
-## 4:      1           1      1        1 3 0.695
-## 5:      1           1      1        1 4 0.641
-## 6:      1           1      1        1 5 0.597
+## 2: 1 1 1 1 1 0.852 +## 3: 1 1 1 1 2 0.737 +## 4: 1 1 1 1 3 0.656 +## 5: 1 1 1 1 4 0.602 +## 6: 1 1 1 1 5 0.566

We can then compute costs and QALYs (using a discount rate of 3 percent).

# QALYs
 ictstm$sim_qalys(dr = .03)
 head(ictstm$qalys_)
-
##    sample strategy_id grp_id state_id   dr    qalys      lys
-## 1:      1           1      1        1 0.03 5.543359 8.699912
-## 2:      1           1      1        2 0.03 1.705305 1.713324
-## 3:      1           2      1        1 0.03 5.755085 9.032201
-## 4:      1           2      1        2 0.03 1.316231 1.322421
-## 5:      2           1      1        1 0.03 3.083845 8.913862
-## 6:      2           1      1        2 0.03 1.984718 2.029173
+
##    sample strategy_id grp_id state_id   dr     qalys      lys
+## 1:      1           1      1        1 0.03 3.8782352 8.308862
+## 2:      1           1      1        2 0.03 1.2436510 1.436376
+## 3:      1           2      1        1 0.03 4.4007174 9.428246
+## 4:      1           2      1        2 0.03 0.8705819 1.005493
+## 5:      2           1      1        1 0.03 7.1224034 8.321687
+## 6:      2           1      1        2 0.03 1.1361525 1.680697
# Costs
 ictstm$sim_costs(dr = .03)
 head(ictstm$costs_)
##    sample strategy_id grp_id state_id   dr category     costs      lys
-## 1:      1           1      1        1 0.03    drugs 43499.561 8.699912
-## 2:      1           1      1        2 0.03    drugs  8566.622 1.713324
-## 3:      1           2      1        1 0.03    drugs 90322.012 9.032201
-## 4:      1           2      1        2 0.03    drugs 13224.213 1.322421
-## 5:      2           1      1        1 0.03    drugs 44569.309 8.913862
-## 6:      2           1      1        2 0.03    drugs 10145.863 2.029173
+## 1: 1 1 1 1 0.03 drugs 41544.311 8.308862 +## 2: 1 1 1 2 0.03 drugs 7181.880 1.436376 +## 3: 1 2 1 1 0.03 drugs 94282.456 9.428246 +## 4: 1 2 1 2 0.03 drugs 10054.935 1.005493 +## 5: 2 1 1 1 0.03 drugs 41608.437 8.321687 +## 6: 2 1 1 2 0.03 drugs 8403.483 1.680697
@@ -646,31 +646,31 @@

print(ce)

## $costs
 ##       category   dr sample strategy_id     costs grp_id
-##    1:    drugs 0.03      1           1  52066.18      1
-##    2:    drugs 0.03      1           2 103546.22      1
-##    3:    drugs 0.03      2           1  54715.17      1
-##    4:    drugs 0.03      2           2 118607.21      1
-##    5:    drugs 0.03      3           1  46923.96      1
+##    1:    drugs 0.03      1           1  48726.19      1
+##    2:    drugs 0.03      1           2 104337.39      1
+##    3:    drugs 0.03      2           1  50011.92      1
+##    4:    drugs 0.03      2           2  96468.83      1
+##    5:    drugs 0.03      3           1  53825.34      1
 ##   ---                                                  
-## 5996:    total 0.03    998           2 123762.00      1
-## 5997:    total 0.03    999           1  68575.32      1
-## 5998:    total 0.03    999           2 117026.68      1
-## 5999:    total 0.03   1000           1  66484.09      1
-## 6000:    total 0.03   1000           2 106268.38      1
+## 5996:    total 0.03    998           2 112139.81      1
+## 5997:    total 0.03    999           1  62089.10      1
+## 5998:    total 0.03    999           2 110614.22      1
+## 5999:    total 0.03   1000           1  60063.06      1
+## 6000:    total 0.03   1000           2 109835.51      1
 ## 
 ## $qalys
 ##         dr sample strategy_id    qalys grp_id
-##    1: 0.03      1           1 7.248664      1
-##    2: 0.03      1           2 7.071317      1
-##    3: 0.03      2           1 5.068563      1
-##    4: 0.03      2           2 4.918687      1
-##    5: 0.03      3           1 6.322657      1
+##    1: 0.03      1           1 5.121886      1
+##    2: 0.03      1           2 5.271299      1
+##    3: 0.03      2           1 8.258556      1
+##    4: 0.03      2           2 8.078899      1
+##    5: 0.03      3           1 6.067078      1
 ##   ---                                        
-## 1996: 0.03    998           2 9.156409      1
-## 1997: 0.03    999           1 7.449624      1
-## 1998: 0.03    999           2 6.819781      1
-## 1999: 0.03   1000           1 6.203686      1
-## 2000: 0.03   1000           2 5.427262      1
+## 1996: 0.03    998           2 8.612026      1
+## 1997: 0.03    999           1 8.790312      1
+## 1998: 0.03    999           2 8.553738      1
+## 1999: 0.03   1000           1 4.285208      1
+## 2000: 0.03   1000           2 4.142444      1
 ## 
 ## attr(,"class")
 ## [1] "ce"
diff --git a/docs/articles/intro_files/figure-html/ceac_plot-1.png b/docs/articles/intro_files/figure-html/ceac_plot-1.png index 19f0e8bc..65397167 100644 Binary files a/docs/articles/intro_files/figure-html/ceac_plot-1.png and b/docs/articles/intro_files/figure-html/ceac_plot-1.png differ diff --git a/docs/articles/markov-cohort.html b/docs/articles/markov-cohort.html index 5f1ac943..4ee12c3a 100644 --- a/docs/articles/markov-cohort.html +++ b/docs/articles/markov-cohort.html @@ -37,7 +37,7 @@ hesim - 0.4.0 + 0.4.1 @@ -116,7 +116,7 @@ -

The incremental cost-effectiveness ratio (ICER) estimated using means from the PSA is $6,217, which is very close to the estimate from the deterministic analysis from Chancellor et al. 

+

The incremental cost-effectiveness ratio (ICER) estimated using means from the PSA is $6,355, which is very close to the estimate from the deterministic analysis from Chancellor et al. 

icer_tbl(cea_pw_out)
##                   1   2                        
-## Incremental QALYs "-" "0.93 (0.54, 1.21)"      
-## Incremental costs "-" "5,795 (2,469, 10,124)"  
-## Incremental NMB   "-" "40,810 (22,501, 54,809)"
-## ICER              "-" "6,217"                  
+## Incremental QALYs "-" "0.93 (0.56, 1.23)"      
+## Incremental costs "-" "5,913 (3,165, 10,158)"  
+## Incremental NMB   "-" "40,607 (23,094, 55,887)"
+## ICER              "-" "6,355"                  
 ## Conclusion        "-" "Cost-effective"
-

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.946 and approaches 1 at slightly higher WTP values.

+

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.943 and approaches 1 at slightly higher WTP values.

ggplot(cea_pw_out$ceac,
        aes(x = k, y = prob,
            col = factor(strategy_id, labels = strategies$strategy_name[-1]))) +
diff --git a/docs/articles/markov-cohort_files/figure-html/ceac-1.png b/docs/articles/markov-cohort_files/figure-html/ceac-1.png
index dcc85c97..8d6ba49a 100644
Binary files a/docs/articles/markov-cohort_files/figure-html/ceac-1.png and b/docs/articles/markov-cohort_files/figure-html/ceac-1.png differ
diff --git a/docs/articles/markov-cohort_files/figure-html/simStateprobs-1.png b/docs/articles/markov-cohort_files/figure-html/simStateprobs-1.png
index c49c2fbc..5b1450fe 100644
Binary files a/docs/articles/markov-cohort_files/figure-html/simStateprobs-1.png and b/docs/articles/markov-cohort_files/figure-html/simStateprobs-1.png differ
diff --git a/docs/articles/markov-inhomogeneous-cohort.html b/docs/articles/markov-inhomogeneous-cohort.html
index f8305c11..1c3d210c 100644
--- a/docs/articles/markov-inhomogeneous-cohort.html
+++ b/docs/articles/markov-inhomogeneous-cohort.html
@@ -37,7 +37,7 @@
       
       
         hesim
-        0.4.0
+        0.4.1
       
     
@@ -116,7 +116,7 @@
##    strategy_id grp_id     mean
-## 1:           1      2 14.64739
-## 2:           2      2 14.69099
+## 1: 1 2 14.64591 +## 2: 2 2 14.68975
ce_sim$costs[grp_id == 2 & category == "total",
             .(mean = mean(costs)),
               by = c("strategy_id", "grp_id")]
##    strategy_id grp_id     mean
-## 1:           1      2 510.4780
-## 2:           2      2 612.3224
+## 1: 1 2 511.6709 +## 2: 2 2 612.9088

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 covariates.

icer_tbl(cea_pw_out, output = "data.table")
-
##     strategy_id grp_id            iqalys         icosts                  inmb
-##  1:           2      1 0.07 (0.03, 0.13)  69 (-24, 137)  3,461 (1,358, 6,505)
-##  2:           2      2 0.04 (0.02, 0.08)  102 (32, 151)    2,078 (793, 4,023)
-##  3:           2      3 0.03 (0.01, 0.05)  127 (77, 162)    1,173 (402, 2,315)
-##  4:           2      4 0.01 (0.01, 0.03) 146 (111, 170)      602 (151, 1,277)
-##  5:           2      5 0.01 (0.00, 0.02) 160 (136, 175)          261 (9, 649)
-##  6:           2      6 0.11 (0.05, 0.21) -28 (-205, 97) 5,674 (2,348, 10,621)
-##  7:           2      7 0.07 (0.03, 0.13)  35 (-86, 124)  3,390 (1,343, 6,441)
-##  8:           2      8 0.04 (0.02, 0.07)   83 (-5, 144)    1,924 (729, 3,628)
-##  9:           2      9 0.02 (0.01, 0.04)  117 (55, 158)    1,024 (345, 2,033)
-## 10:           2     10 0.01 (0.01, 0.02) 142 (100, 169)      495 (111, 1,072)
+
##     strategy_id grp_id            iqalys          icosts                  inmb
+##  1:           2      1 0.07 (0.03, 0.14)   69 (-29, 142)  3,469 (1,248, 6,751)
+##  2:           2      2 0.04 (0.02, 0.09)   101 (29, 154)    2,091 (711, 4,208)
+##  3:           2      3 0.03 (0.01, 0.05)   127 (74, 164)    1,185 (350, 2,506)
+##  4:           2      4 0.02 (0.01, 0.03)  146 (108, 171)      611 (123, 1,337)
+##  5:           2      5 0.01 (0.00, 0.02)  160 (134, 176)        267 (-12, 690)
+##  6:           2      6 0.11 (0.04, 0.21) -28 (-222, 104) 5,703 (1,970, 10,757)
+##  7:           2      7 0.07 (0.02, 0.13)  34 (-104, 129)  3,419 (1,154, 6,471)
+##  8:           2      8 0.04 (0.02, 0.08)   82 (-15, 148)    1,948 (624, 3,854)
+##  9:           2      9 0.02 (0.01, 0.04)   117 (50, 161)    1,041 (277, 2,149)
+## 10:           2     10 0.01 (0.00, 0.02)   141 (95, 170)       507 (76, 1,134)
 ##          icer     conclusion
-##  1:       978 Cost-effective
-##  2:     2,336 Cost-effective
-##  3:     4,895 Cost-effective
-##  4:     9,776 Cost-effective
-##  5:    19,004 Cost-effective
+##  1:       970 Cost-effective
+##  2:     2,309 Cost-effective
+##  3:     4,831 Cost-effective
+##  4:     9,631 Cost-effective
+##  5:    18,694 Cost-effective
 ##  6: Dominates Cost-effective
-##  7:       512 Cost-effective
-##  8:     2,064 Cost-effective
-##  9:     5,142 Cost-effective
-## 10:    11,132 Cost-effective
+## 7: 495 Cost-effective +## 8: 2,017 Cost-effective +## 9: 5,031 Cost-effective +## 10: 10,893 Cost-effective

@@ -584,10 +584,10 @@

k = wtp) icer_tbl(cea_pw_out)

##                   1   2                   
-## Incremental QALYs "-" "0.03 (0.01, 0.05)" 
-## Incremental costs "-" "119 (61, 158)"     
-## Incremental NMB   "-" "1,296 (479, 2,565)"
-## ICER              "-" "4,209"             
+## Incremental QALYs "-" "0.03 (0.01, 0.06)" 
+## Incremental costs "-" "118 (59, 161)"     
+## Incremental NMB   "-" "1,309 (398, 2,721)"
+## ICER              "-" "4,148"             
 ## Conclusion        "-" "Cost-effective"
@@ -745,11 +745,11 @@

) tpmat[1, ]
##    s1_s1     s1_s2 s1_s3 s1_s4      s1_s5 s2_s1     s2_s2        s2_s3 s2_s4
-## 1:     0 0.9748585     0     0 0.02514153     0 0.9927103 0.0005896571     0
+## 1:     0 0.9862254     0     0 0.01377463     0 0.9928495 0.0004504947     0
 ##     s2_s5 s3_s1 s3_s2 s3_s3     s3_s4      s3_s5 s4_s1 s4_s2      s4_s3
-## 1: 0.0067     0     0     0 0.9681585 0.03184153     0     0 0.03808487
+## 1: 0.0067     0     0     0 0.9795254 0.02047463     0     0 0.03188317
 ##        s4_s4  s4_s5 s5_s1 s5_s2 s5_s3 s5_s4 s5_s5
-## 1: 0.9552151 0.0067     0     0     0     0     1
+## 1: 0.9614168 0.0067 0 0 0 0 1

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

tparams_transprobs <- tparams_transprobs(tpmat, tpmat_id)
@@ -768,14 +768,14 @@

.(mean = mean(qalys)), by = c("strategy_id", "grp_id")]
##    strategy_id grp_id     mean
-## 1:           1      2 14.64506
-## 2:           2      2 14.69003
+## 1: 1 2 14.64575 +## 2: 2 2 14.69076
ce_sim$costs[grp_id == 2 & category == "total",
             .(mean = mean(costs)),
               by = c("strategy_id", "grp_id")]
##    strategy_id grp_id     mean
-## 1:           1      2 513.3623
-## 2:           2      2 613.0674
+## 1: 1 2 512.5857 +## 2: 2 2 611.8638

However, time to construct the transition model was 3.3 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 increased.

data.table(
   Method = c("define_model()", "Custom tpmatrix()"),
@@ -807,13 +807,13 @@ 

define_model() -4.024 +3.900 -0.743 +0.740 -4.884 +5.054 @@ -821,13 +821,13 @@

Custom tpmatrix() -1.066 +1.087 -0.413 +0.418 -1.490 +1.535 diff --git a/docs/articles/markov-inhomogeneous-cohort_files/figure-html/simStateprobsPlot-1.png b/docs/articles/markov-inhomogeneous-cohort_files/figure-html/simStateprobsPlot-1.png index fba358db..00f34f4c 100644 Binary files a/docs/articles/markov-inhomogeneous-cohort_files/figure-html/simStateprobsPlot-1.png and b/docs/articles/markov-inhomogeneous-cohort_files/figure-html/simStateprobsPlot-1.png differ diff --git a/docs/articles/markov-inhomogeneous-indiv.html b/docs/articles/markov-inhomogeneous-indiv.html index 6186953d..b9a93d4c 100644 --- a/docs/articles/markov-inhomogeneous-indiv.html +++ b/docs/articles/markov-inhomogeneous-indiv.html @@ -37,7 +37,7 @@ hesim - 0.4.0 + 0.4.1

@@ -116,7 +116,7 @@
##    strategy_id     mean
-## 1:           1 15.18460
-## 2:           2 15.23408
+## 1: 1 15.23980 +## 2: 2 15.27757
ce_sim$costs[category == "total",
             .(mean = mean(costs)),
               by = c("strategy_id")]
-
##    strategy_id     mean
-## 1:           1 513.6415
-## 2:           2 613.2501
+
##    strategy_id    mean
+## 1:           1 516.242
+## 2:           2 611.826
@@ -654,10 +654,10 @@

k = seq(0, 25000, 500)) icer_tbl(cea_pw_out)
##                   1   2                        
-## Incremental QALYs "-" "0.05 (-0.47, 0.57)"     
-## Incremental costs "-" "100 (10, 164)"          
-## Incremental NMB   "-" "2,374 (-23,595, 28,210)"
-## ICER              "-" "2,013"                  
+## Incremental QALYs "-" "0.04 (-0.44, 0.56)"     
+## Incremental costs "-" "96 (-27, 162)"          
+## Incremental NMB   "-" "1,793 (-22,125, 27,967)"
+## ICER              "-" "2,531"                  
 ## Conclusion        "-" "Cost-effective"
diff --git a/docs/articles/markov-inhomogeneous-indiv_files/figure-html/unnamed-chunk-28-1.png b/docs/articles/markov-inhomogeneous-indiv_files/figure-html/unnamed-chunk-28-1.png index 579ee074..68d82687 100644 Binary files a/docs/articles/markov-inhomogeneous-indiv_files/figure-html/unnamed-chunk-28-1.png and b/docs/articles/markov-inhomogeneous-indiv_files/figure-html/unnamed-chunk-28-1.png differ diff --git a/docs/articles/mlogit.html b/docs/articles/mlogit.html index fd151fe9..1901f1ed 100644 --- a/docs/articles/mlogit.html +++ b/docs/articles/mlogit.html @@ -37,7 +37,7 @@ hesim - 0.4.0 + 0.4.1 @@ -116,7 +116,7 @@
##    patient_id      age female grp_id
-## 1:       1494 18.17836      0      1
-## 2:       8622 48.90696      1      2
-## 3:       8025 79.13320      0      3
-## 4:       8641 87.89424      1      4
-## 5:       7022 28.52059      0      5
-## 6:       4954 57.51247      1      6
+## 1: 4272 20.91503 0 1 +## 2: 2580 54.03825 0 2 +## 3: 3657 93.83567 0 3 +## 4: 6475 25.13849 1 4 +## 5: 6381 75.61936 1 5 +## 6: 3028 73.99316 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 life-years (QALYs) are the healthy and sick states.

hesim_dat <- hesim_data(
   patients = patients,
diff --git a/docs/articles/mlogit_files/figure-html/icerHeterogeneity-1.png b/docs/articles/mlogit_files/figure-html/icerHeterogeneity-1.png
index c0f40ffe..e9a6099b 100644
Binary files a/docs/articles/mlogit_files/figure-html/icerHeterogeneity-1.png and b/docs/articles/mlogit_files/figure-html/icerHeterogeneity-1.png differ
diff --git a/docs/articles/mlogit_files/figure-html/stateprobs-1.png b/docs/articles/mlogit_files/figure-html/stateprobs-1.png
index 9f933992..cf0332bc 100644
Binary files a/docs/articles/mlogit_files/figure-html/stateprobs-1.png and b/docs/articles/mlogit_files/figure-html/stateprobs-1.png differ
diff --git a/docs/articles/mstate.html b/docs/articles/mstate.html
index b72285da..4e6798c1 100644
--- a/docs/articles/mstate.html
+++ b/docs/articles/mstate.html
@@ -37,7 +37,7 @@
       
       
         hesim
-        0.4.0
+        0.4.1
       
     
@@ -116,7 +116,7 @@
##    strategy_id patient_id      age female
-## 1:           1          1 32.49260      1
-## 2:           1          2 38.29160      0
-## 3:           1          3 63.23587      1
-## 4:           1          4 53.17408      1
-## 5:           1          5 55.76990      1
-## 6:           1          6 39.80207      1
+## 1: 1 1 44.70252 1 +## 2: 1 2 46.30334 1 +## 3: 1 3 46.70021 0 +## 4: 1 4 53.67194 0 +## 5: 1 5 34.85417 0 +## 6: 1 6 51.12398 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 starting age of each patient in the simulation (by default, patients are assumed to live no longer than age 100 in the individual-level simulation).

transmod_cr <- create_IndivCtstmTrans(wei_fits_cr, transmod_data,
                                       trans_mat = tmat, n = n_samples,
@@ -320,13 +320,13 @@ 

# "Clock reset"
 econmod_cr$sim_disease()
 head(econmod_cr$disprog_)
-
##    sample strategy_id patient_id grp_id from to final time_start time_stop
-## 1:      1           1          1      1    1  2     0  0.0000000 0.1613725
-## 2:      1           1          1      1    2  3     1  0.1613725 2.7544632
-## 3:      1           1          2      1    1  2     0  0.0000000 6.0518403
-## 4:      1           1          2      1    2  1     0  6.0518403 6.2904162
-## 5:      1           1          2      1    1  2     0  6.2904162 6.5126016
-## 6:      1           1          2      1    2  3     1  6.5126016 7.3866817
+
##    sample strategy_id patient_id grp_id from to final time_start  time_stop
+## 1:      1           1          1      1    1  2     0  0.0000000  0.4426233
+## 2:      1           1          1      1    2  1     0  0.4426233  0.8347335
+## 3:      1           1          1      1    1  3     1  0.8347335 10.1059473
+## 4:      1           1          2      1    1  3     1  0.0000000  2.3750032
+## 5:      1           1          3      1    1  2     0  0.0000000  1.0297401
+## 6:      1           1          3      1    2  1     0  1.0297401  5.1060423
# "Clock forward"
 econmod_cf$sim_disease()

State occupancy probabilities at different time points are computed using $sim_stateprobs(). First, we simulate state probabilities for the “clock reset” model.

@@ -378,13 +378,13 @@

QALYs (and life-years) are simulated using $sim_qalys(). By default, mean QALYs are computed by treatment strategy, health state, and PSA sample (the by_patient option can be used to compute aggregated QALYs at the patient level). Here, we used the “clock reset” model to compute both undiscounted QALYs (dr = 0) and QALYs discounted at 3%.

econmod_cr$sim_qalys(dr = c(0,.03))
 head(econmod_cr$qalys_)
-
##    sample strategy_id grp_id state_id dr     qalys      lys
-## 1:      1           1      1        1  0 2.9387678 5.220211
-## 2:      1           1      1        2  0 1.5141771 1.537791
-## 3:      1           2      1        1  0 3.9118593 6.948739
-## 4:      1           2      1        2  0 0.9539457 0.968823
-## 5:      2           1      1        1  0 5.2050937 6.158292
-## 6:      2           1      1        2  0 1.1480932 1.305187
+
##    sample strategy_id grp_id state_id dr    qalys      lys
+## 1:      1           1      1        1  0 4.405607 6.065167
+## 2:      1           1      1        2  0 1.087979 1.228349
+## 3:      1           2      1        1  0 6.845010 9.423476
+## 4:      1           2      1        2  0 1.141186 1.288421
+## 5:      2           1      1        1  0 4.839256 5.770316
+## 6:      2           1      1        2  0 1.405051 1.467449

We summarize the simulated QALYs by computing means by treatment strategy and health state across the PSA samples.

qalys_summary <- econmod_cr$qalys_[, .(mean = mean(qalys)),
                                     by = c("strategy_id", "state_id", "dr")]
@@ -404,12 +404,12 @@ 

econmod_cr$sim_costs(dr = 0.03)
 head(econmod_cr$costs_)
##    sample strategy_id grp_id state_id   dr category     costs       lys
-## 1:      1           1      1        1 0.03     Drug 21333.554 4.2667108
-## 2:      1           1      1        2 0.03     Drug  6210.616 1.2421231
-## 3:      1           2      1        1 0.03     Drug 55022.758 5.5022758
-## 4:      1           2      1        2 0.03     Drug  7836.761 0.7836761
-## 5:      2           1      1        1 0.03     Drug 24985.439 4.9970879
-## 6:      2           1      1        2 0.03     Drug  5316.969 1.0633937
+## 1: 1 1 1 1 0.03 Drug 24467.515 4.8935030 +## 2: 1 1 1 2 0.03 Drug 4979.900 0.9959801 +## 3: 1 2 1 1 0.03 Drug 69380.371 6.9380371 +## 4: 1 2 1 2 0.03 Drug 9786.563 0.9786563 +## 5: 2 1 1 1 0.03 Drug 23507.274 4.7014547 +## 6: 2 1 1 2 0.03 Drug 5997.631 1.1995262

As with QALYs, we summarize costs by computing means (now by treatment strategy and category) across the PSA samples.

library("scales")
 costs_summary <- econmod_cr$costs_[dr == .03 , .(mean = mean(costs)),
diff --git a/docs/articles/mstate_files/figure-html/costs_plot-1.png b/docs/articles/mstate_files/figure-html/costs_plot-1.png
index 96cd72ce..26d56bee 100644
Binary files a/docs/articles/mstate_files/figure-html/costs_plot-1.png and b/docs/articles/mstate_files/figure-html/costs_plot-1.png differ
diff --git a/docs/articles/mstate_files/figure-html/qalys_plot-1.png b/docs/articles/mstate_files/figure-html/qalys_plot-1.png
index ae7177f3..f4fff3f5 100644
Binary files a/docs/articles/mstate_files/figure-html/qalys_plot-1.png and b/docs/articles/mstate_files/figure-html/qalys_plot-1.png differ
diff --git a/docs/articles/mstate_files/figure-html/stprobs_by_strategy_plot-1.png b/docs/articles/mstate_files/figure-html/stprobs_by_strategy_plot-1.png
index b3f4e7bb..d5cc1d7d 100644
Binary files a/docs/articles/mstate_files/figure-html/stprobs_by_strategy_plot-1.png and b/docs/articles/mstate_files/figure-html/stprobs_by_strategy_plot-1.png differ
diff --git a/docs/articles/mstate_files/figure-html/stprobs_by_timescale_plot-1.png b/docs/articles/mstate_files/figure-html/stprobs_by_timescale_plot-1.png
index 704814e5..cf85acae 100644
Binary files a/docs/articles/mstate_files/figure-html/stprobs_by_timescale_plot-1.png and b/docs/articles/mstate_files/figure-html/stprobs_by_timescale_plot-1.png differ
diff --git a/docs/articles/psm.html b/docs/articles/psm.html
index 3f0a26cb..51d25588 100644
--- a/docs/articles/psm.html
+++ b/docs/articles/psm.html
@@ -37,7 +37,7 @@
       
       
         hesim
-        0.4.0
+        0.4.1
       
     
@@ -116,7 +116,7 @@ diff --git a/docs/index.html b/docs/index.html index d21599e8..ba7f007b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@ hesim - 0.4.0 + 0.4.1
diff --git a/docs/news/index.html b/docs/news/index.html index 8823fb86..0253a8a6 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -81,7 +81,7 @@ hesim - 0.4.0 + 0.4.1

@@ -162,6 +162,11 @@

Changelog

Source: NEWS.md +
+

+hesim 0.4.1

+

Minor updates to the documentation and fixes to small problems in the C++ code identified with the CRAN package checks.

+

hesim 0.4.0

diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index dd953781..ef846e6c 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -11,7 +11,7 @@ articles: mlogit: mlogit.html mstate: mstate.html psm: psm.html -last_built: 2020-09-29T05:43Z +last_built: 2020-10-02T05:29Z urls: reference: https://hesim-dev.github.io/hesim/reference article: https://hesim-dev.github.io/hesim/articles diff --git a/docs/reference/CohortDtstm.html b/docs/reference/CohortDtstm.html index b21437a9..e608aa8f 100644 --- a/docs/reference/CohortDtstm.html +++ b/docs/reference/CohortDtstm.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1
diff --git a/docs/reference/CohortDtstmTrans.html b/docs/reference/CohortDtstmTrans.html index 36f29dcb..14ac760d 100644 --- a/docs/reference/CohortDtstmTrans.html +++ b/docs/reference/CohortDtstmTrans.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/CtstmTrans.html b/docs/reference/CtstmTrans.html index 207e20dd..b19a13b5 100644 --- a/docs/reference/CtstmTrans.html +++ b/docs/reference/CtstmTrans.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/IndivCtstm.html b/docs/reference/IndivCtstm.html index 843cf1a4..90b9983a 100644 --- a/docs/reference/IndivCtstm.html +++ b/docs/reference/IndivCtstm.html @@ -86,7 +86,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/IndivCtstmTrans.html b/docs/reference/IndivCtstmTrans.html index aeab8e70..3b0fea64 100644 --- a/docs/reference/IndivCtstmTrans.html +++ b/docs/reference/IndivCtstmTrans.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/Psm.html b/docs/reference/Psm.html index d128f3a7..3593d4fa 100644 --- a/docs/reference/Psm.html +++ b/docs/reference/Psm.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/PsmCurves.html b/docs/reference/PsmCurves.html index 60516e65..fc3bc3ab 100644 --- a/docs/reference/PsmCurves.html +++ b/docs/reference/PsmCurves.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/StateVals.html b/docs/reference/StateVals.html index 7d4e917e..7c4a5e1e 100644 --- a/docs/reference/StateVals.html +++ b/docs/reference/StateVals.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/absorbing.html b/docs/reference/absorbing.html index f70c9156..3a1de6b3 100644 --- a/docs/reference/absorbing.html +++ b/docs/reference/absorbing.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/bootstrap.html b/docs/reference/bootstrap.html index 65f379f5..ebd8db82 100644 --- a/docs/reference/bootstrap.html +++ b/docs/reference/bootstrap.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/ce.html b/docs/reference/ce.html index b321b2f0..176ff1fd 100644 --- a/docs/reference/ce.html +++ b/docs/reference/ce.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/cea.html b/docs/reference/cea.html index aa238027..921446e1 100644 --- a/docs/reference/cea.html +++ b/docs/reference/cea.html @@ -93,7 +93,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/check.html b/docs/reference/check.html index fdee9615..00a6825f 100644 --- a/docs/reference/check.html +++ b/docs/reference/check.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/check_edata.html b/docs/reference/check_edata.html index 10a873a1..529fa462 100644 --- a/docs/reference/check_edata.html +++ b/docs/reference/check_edata.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/costs.html b/docs/reference/costs.html index 829f793b..a6c67043 100644 --- a/docs/reference/costs.html +++ b/docs/reference/costs.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/create_CohortDtstm.html b/docs/reference/create_CohortDtstm.html index c9fbed33..8ad002a9 100644 --- a/docs/reference/create_CohortDtstm.html +++ b/docs/reference/create_CohortDtstm.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/create_CohortDtstmTrans.html b/docs/reference/create_CohortDtstmTrans.html index b129b627..1cb49e49 100644 --- a/docs/reference/create_CohortDtstmTrans.html +++ b/docs/reference/create_CohortDtstmTrans.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/create_IndivCtstmTrans.html b/docs/reference/create_IndivCtstmTrans.html index 373c691c..84294329 100644 --- a/docs/reference/create_IndivCtstmTrans.html +++ b/docs/reference/create_IndivCtstmTrans.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/create_PsmCurves.html b/docs/reference/create_PsmCurves.html index b1a9218c..2f9734b1 100644 --- a/docs/reference/create_PsmCurves.html +++ b/docs/reference/create_PsmCurves.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/create_StateVals.html b/docs/reference/create_StateVals.html index a7eb29e4..7b595188 100644 --- a/docs/reference/create_StateVals.html +++ b/docs/reference/create_StateVals.html @@ -84,7 +84,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/create_input_mats.html b/docs/reference/create_input_mats.html index 6eb062ad..87386e87 100644 --- a/docs/reference/create_input_mats.html +++ b/docs/reference/create_input_mats.html @@ -86,7 +86,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/create_lines_dt.html b/docs/reference/create_lines_dt.html index 7838917b..bdfcf6e3 100644 --- a/docs/reference/create_lines_dt.html +++ b/docs/reference/create_lines_dt.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/create_object_list.html b/docs/reference/create_object_list.html index 6d29094d..bb969ada 100644 --- a/docs/reference/create_object_list.html +++ b/docs/reference/create_object_list.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/create_params.html b/docs/reference/create_params.html index cdf366f0..98a64761 100644 --- a/docs/reference/create_params.html +++ b/docs/reference/create_params.html @@ -84,7 +84,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/create_trans_dt.html b/docs/reference/create_trans_dt.html index c61ef2d6..b1c7b10f 100644 --- a/docs/reference/create_trans_dt.html +++ b/docs/reference/create_trans_dt.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/define_model.html b/docs/reference/define_model.html index 4748f4ae..35c7fc2e 100644 --- a/docs/reference/define_model.html +++ b/docs/reference/define_model.html @@ -86,7 +86,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/define_rng.html b/docs/reference/define_rng.html index dfca93a5..0eaec294 100644 --- a/docs/reference/define_rng.html +++ b/docs/reference/define_rng.html @@ -85,7 +85,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/define_tparams.html b/docs/reference/define_tparams.html index a972ff58..5257fbba 100644 --- a/docs/reference/define_tparams.html +++ b/docs/reference/define_tparams.html @@ -88,7 +88,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/disprog.html b/docs/reference/disprog.html index 12bb78aa..7825de01 100644 --- a/docs/reference/disprog.html +++ b/docs/reference/disprog.html @@ -84,7 +84,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/expand.hesim_data.html b/docs/reference/expand.hesim_data.html index 9c5ec47b..a130aed4 100644 --- a/docs/reference/expand.hesim_data.html +++ b/docs/reference/expand.hesim_data.html @@ -84,7 +84,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/expand.html b/docs/reference/expand.html index 8fa84359..b12bed0e 100644 --- a/docs/reference/expand.html +++ b/docs/reference/expand.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/fast_rgengamma.html b/docs/reference/fast_rgengamma.html index c23aa217..4cd18da7 100644 --- a/docs/reference/fast_rgengamma.html +++ b/docs/reference/fast_rgengamma.html @@ -84,7 +84,7 @@ hesim - 0.4.0 + 0.4.1 @@ -208,7 +208,7 @@

Examp ptm <- proc.time() r1 <- fast_rgengamma(n, mu = m, sigma = s, Q = q) proc.time() - ptm
#> user system elapsed -#> 0.001 0.000 0.002
ptm <- proc.time() +#> 0.001 0.000 0.001
ptm <- proc.time() library("flexsurv") r2 <- flexsurv::rgengamma(n, mu = m, sigma = s, Q = q) proc.time() - ptm
#> user system elapsed diff --git a/docs/reference/flexsurvreg_list.html b/docs/reference/flexsurvreg_list.html index c30ee791..6fab6408 100644 --- a/docs/reference/flexsurvreg_list.html +++ b/docs/reference/flexsurvreg_list.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1
diff --git a/docs/reference/formula_list.html b/docs/reference/formula_list.html index 0b6a5c0f..f151ac48 100644 --- a/docs/reference/formula_list.html +++ b/docs/reference/formula_list.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/hesim.html b/docs/reference/hesim.html index ed59f3c5..7f5eafad 100644 --- a/docs/reference/hesim.html +++ b/docs/reference/hesim.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/hesim_data.html b/docs/reference/hesim_data.html index f4abbc5d..8a4cf60a 100644 --- a/docs/reference/hesim_data.html +++ b/docs/reference/hesim_data.html @@ -84,7 +84,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/hesim_survdists.html b/docs/reference/hesim_survdists.html index 297ab2fe..1beab1c7 100644 --- a/docs/reference/hesim_survdists.html +++ b/docs/reference/hesim_survdists.html @@ -84,7 +84,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/icea.html b/docs/reference/icea.html index d7be2867..040f7c16 100644 --- a/docs/reference/icea.html +++ b/docs/reference/icea.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/icer_tbl.html b/docs/reference/icer_tbl.html index 957655d1..e8e463cd 100644 --- a/docs/reference/icer_tbl.html +++ b/docs/reference/icer_tbl.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/id_attributes.html b/docs/reference/id_attributes.html index 9689c047..0c65040b 100644 --- a/docs/reference/id_attributes.html +++ b/docs/reference/id_attributes.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/incr_effect.html b/docs/reference/incr_effect.html index e69b088d..cc827768 100644 --- a/docs/reference/incr_effect.html +++ b/docs/reference/incr_effect.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/index.html b/docs/reference/index.html index b9d59cb3..91aa0a62 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -81,7 +81,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/input_mats.html b/docs/reference/input_mats.html index 92c94531..c4942b4c 100644 --- a/docs/reference/input_mats.html +++ b/docs/reference/input_mats.html @@ -85,7 +85,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/joined.html b/docs/reference/joined.html index a35c713e..dfd22aae 100644 --- a/docs/reference/joined.html +++ b/docs/reference/joined.html @@ -87,7 +87,7 @@ hesim - 0.4.0 + 0.4.1 @@ -221,15 +221,15 @@

Examp print(joined_fm)
#> $models #> $models$f1 #> ~age -#> <environment: 0x7fb9708a3118> +#> <environment: 0x7fd5c21bf398> #> #> $models$f2 #> ~1 -#> <environment: 0x7fb9708a3118> +#> <environment: 0x7fd5c21bf398> #> #> $models$f3 #> ~age + age2 -#> <environment: 0x7fb9708a3118> +#> <environment: 0x7fd5c21bf398> #> #> #> $times diff --git a/docs/reference/lm_list.html b/docs/reference/lm_list.html index bcd4195f..fabc24b0 100644 --- a/docs/reference/lm_list.html +++ b/docs/reference/lm_list.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1
diff --git a/docs/reference/mom_beta.html b/docs/reference/mom_beta.html index beb81442..9069717e 100644 --- a/docs/reference/mom_beta.html +++ b/docs/reference/mom_beta.html @@ -84,7 +84,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/mom_gamma.html b/docs/reference/mom_gamma.html index 06d30c50..406422d2 100644 --- a/docs/reference/mom_gamma.html +++ b/docs/reference/mom_gamma.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/mstate3_exdata.html b/docs/reference/mstate3_exdata.html index 71e3f609..492b114b 100644 --- a/docs/reference/mstate3_exdata.html +++ b/docs/reference/mstate3_exdata.html @@ -84,7 +84,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/multinom3_exdata.html b/docs/reference/multinom3_exdata.html index b61ed1fc..e8c4c662 100644 --- a/docs/reference/multinom3_exdata.html +++ b/docs/reference/multinom3_exdata.html @@ -84,7 +84,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/multinom_list.html b/docs/reference/multinom_list.html index 8dcf1906..214e3bcf 100644 --- a/docs/reference/multinom_list.html +++ b/docs/reference/multinom_list.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/params.html b/docs/reference/params.html index 98942ab7..e9bdc504 100644 --- a/docs/reference/params.html +++ b/docs/reference/params.html @@ -84,7 +84,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/params_joined_surv.html b/docs/reference/params_joined_surv.html index b276e8b9..2945240c 100644 --- a/docs/reference/params_joined_surv.html +++ b/docs/reference/params_joined_surv.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/params_joined_surv_list.html b/docs/reference/params_joined_surv_list.html index 89141b88..cf84b807 100644 --- a/docs/reference/params_joined_surv_list.html +++ b/docs/reference/params_joined_surv_list.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/params_lm.html b/docs/reference/params_lm.html index 59111b16..47b96554 100644 --- a/docs/reference/params_lm.html +++ b/docs/reference/params_lm.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/params_lm_list.html b/docs/reference/params_lm_list.html index 048c52c4..d7308ffa 100644 --- a/docs/reference/params_lm_list.html +++ b/docs/reference/params_lm_list.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/params_mlogit.html b/docs/reference/params_mlogit.html index 94450a2b..5c81464a 100644 --- a/docs/reference/params_mlogit.html +++ b/docs/reference/params_mlogit.html @@ -84,7 +84,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/params_mlogit_list.html b/docs/reference/params_mlogit_list.html index d16e9e31..ed88cdbe 100644 --- a/docs/reference/params_mlogit_list.html +++ b/docs/reference/params_mlogit_list.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/params_surv.html b/docs/reference/params_surv.html index 4aea2107..5d9fb0c4 100644 --- a/docs/reference/params_surv.html +++ b/docs/reference/params_surv.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/params_surv_list.html b/docs/reference/params_surv_list.html index 026d0e17..2604b1e3 100644 --- a/docs/reference/params_surv_list.html +++ b/docs/reference/params_surv_list.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/partsurvfit.html b/docs/reference/partsurvfit.html index dc5fb07e..40022a60 100644 --- a/docs/reference/partsurvfit.html +++ b/docs/reference/partsurvfit.html @@ -85,7 +85,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/psm4_exdata.html b/docs/reference/psm4_exdata.html index 1c0c0a11..e838dd04 100644 --- a/docs/reference/psm4_exdata.html +++ b/docs/reference/psm4_exdata.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/qalys.html b/docs/reference/qalys.html index e9a000ab..23f144cd 100644 --- a/docs/reference/qalys.html +++ b/docs/reference/qalys.html @@ -84,7 +84,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/rcat.html b/docs/reference/rcat.html index 20ebba99..adea6d60 100644 --- a/docs/reference/rcat.html +++ b/docs/reference/rcat.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 @@ -202,7 +202,7 @@

Examp ptm <- proc.time() samp1 <- rcat(n, pmat) proc.time() - ptm
#> user system elapsed -#> 0.003 0.000 0.002
prop.table(table(samp1))
#> samp1 +#> 0.003 0.000 0.003
prop.table(table(samp1))
#> samp1 #> 1 2 3 #> 0.2015 0.5089 0.2896
# rmultinom from base R @@ -211,7 +211,7 @@

Examp samp2 <- t(apply(pmat, 1, rmultinom, n = 1, size = 1)) samp2 <- apply(samp2, 1, function(x) which(x == 1)) proc.time() - ptm

#> user system elapsed -#> 0.057 0.001 0.060
prop.table(table(samp2))
#> samp2 +#> 0.062 0.002 0.067
prop.table(table(samp2))
#> samp2 #> 1 2 3 #> 0.2015 0.5089 0.2896
diff --git a/docs/reference/rdirichlet_mat.html b/docs/reference/rdirichlet_mat.html index 174672ac..c421d21b 100644 --- a/docs/reference/rdirichlet_mat.html +++ b/docs/reference/rdirichlet_mat.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/rng_distributions.html b/docs/reference/rng_distributions.html index 4984e086..c639ef30 100644 --- a/docs/reference/rng_distributions.html +++ b/docs/reference/rng_distributions.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/rpwexp.html b/docs/reference/rpwexp.html index 16478bc3..e23ec4a3 100644 --- a/docs/reference/rpwexp.html +++ b/docs/reference/rpwexp.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 @@ -206,7 +206,7 @@

Examp ptm <- proc.time() samp <- rpwexp(n, ratemat, t) proc.time() - ptm
#> user system elapsed -#> 0.007 0.001 0.008
summary(samp)
#> Min. 1st Qu. Median Mean 3rd Qu. Max. +#> 0.007 0.001 0.007
summary(samp)
#> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.0000 0.4793 1.1517 1.6597 2.3021 14.4929
diff --git a/docs/reference/stateprobs.html b/docs/reference/stateprobs.html index dbee7b87..72a96642 100644 --- a/docs/reference/stateprobs.html +++ b/docs/reference/stateprobs.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/stateval_tbl.html b/docs/reference/stateval_tbl.html index 3b1d7988..9577ba05 100644 --- a/docs/reference/stateval_tbl.html +++ b/docs/reference/stateval_tbl.html @@ -84,7 +84,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/summarize_ce.html b/docs/reference/summarize_ce.html index 2c6887c8..933db5b5 100644 --- a/docs/reference/summarize_ce.html +++ b/docs/reference/summarize_ce.html @@ -84,7 +84,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/surv_quantile.html b/docs/reference/surv_quantile.html index b0d88a9b..5c40cd7b 100644 --- a/docs/reference/surv_quantile.html +++ b/docs/reference/surv_quantile.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/time_intervals.html b/docs/reference/time_intervals.html index 11bbab93..319ffde7 100644 --- a/docs/reference/time_intervals.html +++ b/docs/reference/time_intervals.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/tparams.html b/docs/reference/tparams.html index 03142daf..105de226 100644 --- a/docs/reference/tparams.html +++ b/docs/reference/tparams.html @@ -86,7 +86,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/tparams_mean.html b/docs/reference/tparams_mean.html index 99dedc22..9d09a1d9 100644 --- a/docs/reference/tparams_mean.html +++ b/docs/reference/tparams_mean.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/tparams_transprobs.html b/docs/reference/tparams_transprobs.html index ceb616fa..e19ab2e4 100644 --- a/docs/reference/tparams_transprobs.html +++ b/docs/reference/tparams_transprobs.html @@ -86,7 +86,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/tpmatrix.html b/docs/reference/tpmatrix.html index ebaf4a3e..7535b521 100644 --- a/docs/reference/tpmatrix.html +++ b/docs/reference/tpmatrix.html @@ -41,8 +41,10 @@ +elements are expressions. It can be used within define_tparams() to +create a transition probability matrix or directly to create a tparams_transprobs() +object. These are, in turn, ultimately used to create a CohortDtstmTrans object +for simulating health state transitions." /> @@ -84,7 +86,7 @@ hesim - 0.4.0 + 0.4.1 @@ -168,8 +170,10 @@

Transition probability matrix

tpmatrix() both defines and evaluates a transition probability matrix in which -elements are expressions. This function is used within define_tparams() to -create a transition probability matrix used for simulation modeling.

+elements are expressions. It can be used within define_tparams() to +create a transition probability matrix or directly to create a tparams_transprobs() +object. These are, in turn, ultimately used to create a CohortDtstmTrans object +for simulating health state transitions.

tpmatrix(...)
@@ -179,9 +183,8 @@

Arg ... -

Named values of expressions defining elements of the matrix. The parameter -values of the matrix elements should refer to parameters defined using -define_rng() or define_tparams().

+

Named values of expressions defining elements of the matrix. See +"Details" and the example below.

@@ -192,14 +195,13 @@

Value

elements ordered rowwise.

Details

-

The matrix is filled rowwise, meaning that each row should sum to 1. It is evaluated -in the environment used by eval_tparams() so that any objects available -within define_tparams() can be used by tpmatrix(). The complementary probability -equal to 1 minus the sum of the probabilities of all other rows can be -conveniently referred to as C.

+

The matrix is filled rowwise, meaning that each row should sum to 1. +The complementary probability (equal to 1 minus the sum of the probabilities +of all other rows) can be conveniently referred to as C.

See also

-

define_model(), define_tparams()

+

define_model(), define_tparams(), +tpmatrix_id(), tparams_transprobs(), CohortDtstmTrans()

Examples

p <- c(.7, .6) diff --git a/docs/reference/tpmatrix_id.html b/docs/reference/tpmatrix_id.html index 74980ae8..f3fd9f3c 100644 --- a/docs/reference/tpmatrix_id.html +++ b/docs/reference/tpmatrix_id.html @@ -84,7 +84,7 @@ hesim - 0.4.0 + 0.4.1
@@ -180,7 +180,7 @@

Arg object

An object of class expanded_hesim_data returned by -expand.hesim_data(). This dataset must either be expanded by treatment +expand.hesim_data(). This dataset must be expanded by treatment strategies, patients, and optionally time intervals.

diff --git a/docs/reference/tpmatrix_names.html b/docs/reference/tpmatrix_names.html index 8a79bb95..8fa11b48 100644 --- a/docs/reference/tpmatrix_names.html +++ b/docs/reference/tpmatrix_names.html @@ -87,7 +87,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/uv_rng.html b/docs/reference/uv_rng.html index 809bbe4b..5a43539a 100644 --- a/docs/reference/uv_rng.html +++ b/docs/reference/uv_rng.html @@ -82,7 +82,7 @@ hesim - 0.4.0 + 0.4.1 diff --git a/docs/reference/weibullNMA.html b/docs/reference/weibullNMA.html index bd429ff9..4f94c968 100644 --- a/docs/reference/weibullNMA.html +++ b/docs/reference/weibullNMA.html @@ -83,7 +83,7 @@ hesim - 0.4.0 + 0.4.1