From f95a187c49f6e6ba95a81e2663ec0d8d3ceecb86 Mon Sep 17 00:00:00 2001 From: marcorubilar <49078203+marcorubilar@users.noreply.github.com> Date: Tue, 9 Apr 2019 11:01:25 -0400 Subject: [PATCH 1/2] Update Appendix C_online_supp.R Diagram of Sick Sicker Model --- Appendix C_online_supp.R | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Appendix C_online_supp.R b/Appendix C_online_supp.R index a48e014..c23fcae 100644 --- a/Appendix C_online_supp.R +++ b/Appendix C_online_supp.R @@ -22,6 +22,10 @@ ############################################################################################ # rm(list = ls()) # remove any variables in R's memory +library(shape) +library(diagram) + + ##################################### Model input ######################################### # Model input n.t <- 30 # time horizon, 30 cycles @@ -78,6 +82,25 @@ m.P <- matrix(c(1 - (p.HS1 + p.HD), p.HS1, 0, p.HD, nrow = n.s, ncol = n.s, byrow = T, dimnames = list (v.n, v.n)) +# Diagram of Sick Sicker model and its initial transition probabilities +# This also can we do it with a function + plotmat(round(t(m.P), 3), pos = c(3,1), # Defining matrix "m.P_trt" and strategies' allocation + lwd = 1, box.lwd = 2, + cex.txt = 0.8, + box.size = 0.1, + box.type = "circle", # shape, e.g. square, circle, rectangle + box.prop = 0.5, + box.col = c("green", "yellow","light blue", "Red"), # shape color + arr.length=.1, + arr.width=.1, + self.cex = .4, + self.shifty = .06, + self.shiftx = -.1, + + main = "Schematic representation of the Sick-Sicker Model", add = FALSE) # title + + + # create the transition trace matrix (m.TR) capturing the proportion of the cohort in each state at each time point m.TR <- matrix(0, nrow = n.t + 1, ncol = n.s, dimnames = list( paste("cycle", 0:n.t, sep = ""), v.n)) From cee5e484978215cd82ffd4d0e7cb990863da7257 Mon Sep 17 00:00:00 2001 From: marcorubilar <49078203+marcorubilar@users.noreply.github.com> Date: Tue, 9 Apr 2019 11:20:55 -0400 Subject: [PATCH 2/2] Update Appendix C_online_supp.R Diagram of Sick Sicker model --- Appendix C_online_supp.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Appendix C_online_supp.R b/Appendix C_online_supp.R index c23fcae..8ce7789 100644 --- a/Appendix C_online_supp.R +++ b/Appendix C_online_supp.R @@ -84,7 +84,7 @@ m.P <- matrix(c(1 - (p.HS1 + p.HD), p.HS1, 0, p.HD, # Diagram of Sick Sicker model and its initial transition probabilities # This also can we do it with a function - plotmat(round(t(m.P), 3), pos = c(3,1), # Defining matrix "m.P_trt" and strategies' allocation + plotmat(round(t(m.P), 3), pos = c(3,1), # Defining matrix "m.P" and strategies' allocation lwd = 1, box.lwd = 2, cex.txt = 0.8, box.size = 0.1,