You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: analysis/cSTM_time_indep.R
+63-50Lines changed: 63 additions & 50 deletions
Original file line number
Diff line number
Diff line change
@@ -39,33 +39,28 @@ rm(list = ls()) # remove any variables in R's memory
39
39
40
40
### Install packages
41
41
# install.packages("dplyr") # to manipulate data
42
-
# install.packages("data.table") # to manipulate data
43
42
# install.packages("tidyr") # to manipulate data
44
43
# install.packages("reshape2") # to manipulate data
45
44
# install.packages("ggplot2") # to visualize data
46
-
# install.packages("gridExtra") # to visualize data
45
+
# install.packages("ggrepel") # to visualize data
46
+
# install.packages("ellipse") # to visualize data
47
47
# install.packages("scales") # for dollar signs and commas
48
-
# install.packages("boot") # to handle log odds and log odds ratios
49
-
# install.packages("devtools") # to ensure compatibility among packages
50
48
# install.packages("dampack") # for CEA and calculate ICERs
51
-
# devtools::install_github("DARTH-git/darthtools") # to install darthtools from GitHub
49
+
# install.packages("devtools") # to install packages from GitHub
50
+
# devtools::install_github("DARTH-git/darthtools") # to install darthtools from GitHub using devtools
52
51
# install.packages("doParallel") # to handle parallel processing
53
52
54
53
### Load packages
55
-
library(dplyr)
56
-
library(data.table)
54
+
library(dplyr)
57
55
library(tidyr)
58
-
library(reshape2)
59
-
library(ggplot2)
60
-
library(ggrepel)
61
-
library(ellipse)
62
-
library(gridExtra)
63
-
library(ggthemes) # For colorblind palettes
64
-
library(scales) # For dollar signs and commas
65
-
library(boot)
66
-
# library(dampack) # Uncomment to use CEA and PSA visualization functionality form dampack instead of the functions included in this repository
67
-
library(darthtools) # For WCC, parameter transformation an matrix checks
68
-
library(doParallel)
56
+
library(reshape2) # For melting data
57
+
library(ggplot2) # For plotting
58
+
library(ggrepel) # For plotting
59
+
library(ellipse) # For plotting
60
+
library(scales) # For dollar signs and commas
61
+
# library(dampack) # Uncomment to use CEA and PSA visualization functionality from dampack instead of the functions included in this repository
62
+
# library(darthtools) # Uncomment to use WCC, parameter transformation, and matrix checks from darthtools instead of the functions included in this repository
63
+
# library(doParallel) # For running PSA in parallel
69
64
70
65
### Load supplementary functions
71
66
source("R/Functions.R")
@@ -95,8 +90,8 @@ v_names_str <- c("Standard of care", # store the strategy names
95
90
n_str<- length(v_names_str) # number of strategies
96
91
97
92
# Within-cycle correction (WCC) using Simpson's 1/3 rule
98
-
v_wcc<-darthtools::gen_wcc(n_cycles=n_cycles,
99
-
method="Simpson1/3") # vector of wcc
93
+
v_wcc<- gen_wcc(n_cycles=n_cycles, # Function included in "R/Functions.R". The latest version can be found in `darthtools` package
94
+
method="Simpson1/3") # vector of wcc
100
95
101
96
## Transition probabilities (annual), and hazard ratios (HRs)
102
97
r_HD<-0.002# constant annual rate of dying when Healthy (all-cause mortality)
p_S1S2_trtB<- rate_to_prob(r=r_S1S2_trtB, t=cycle_length) # Function included in "R/Functions.R". The latest version can be found in `darthtools` package
0 commit comments