Publications by Binh Thang
SIR model with a constant force of infection
In the last 2 etivities, you have learnt how you can represent differential equations in R through the use of the deSolve package. In this etivity you will use this skill to start coding a simplified SIR model within R. Let’s recap first what an SIR model is: The differential equations for this system are: \[\begin{align} \frac{dS}{dt} & = -\l...
15096 sym R (6165 sym/4 pcs) 1 img
W1: Simulating competing hazards (solution)
1 Solution: Simulating competing hazards The model we want to specify in this etivity has 3 compartments: \(I\) (infected), \(R\) (recovered) and \(M\) (dead). Like in the first etivity, infected people can recover at a rate \(\gamma\). Additionally they can also now die (transition to the \(M\) compartment) at a rate \(\mu\). The differential eq...
13787 sym R (5608 sym/19 pcs) 2 img
Modelling an infected cohort 1
1 introduction *In this etivity, you will code your first simple model and use it to answer a research question. To get used to the format for models in R, we’ll start by giving you some parts of the code, and you need to fill in the missing numbers or code blocks by replacing the #YOUR CODE# placeholders. At the end of each etivity, we’ll pr...
19037 sym R (7415 sym/30 pcs) 3 img
Publish Document: Table 4 table
****if deces: 0=death; 1 alive)************* #Prepare: packages, data library("foreign") library("survival") require("moonBook") ## Loading required package: moonBook require("ztable") ## Loading required package: ztable ## Welcome to package ztable ver 0.2.0 require("magrittr") ## Loading required package: magrittr options(ztable.type="html")...
1718 sym R (6415 sym/16 pcs)
Table 3- logistic
#Prepare: packages, data library("foreign") library("survival") require("moonBook") ## Loading required package: moonBook require("ztable") ## Loading required package: ztable ## Welcome to package ztable ver 0.2.0 require("magrittr") ## Loading required package: magrittr options(ztable.type="html") #read data and group for variable Read Data...
902 sym R (28612 sym/72 pcs)
Table 2
****if deces: 0=death; 1 alive)************* #Prepare: packages, data library("foreign") library("survival") require("moonBook") ## Loading required package: moonBook require("ztable") ## Loading required package: ztable ## Welcome to package ztable ver 0.2.0 require("magrittr") ## Loading required package: magrittr options(ztable.type="html")...
15148 sym R (64486 sym/166 pcs) 2 img
Tobit regression - correlation graphs
library(foreign) data=read.dta("C:/Users/BINH THANG-TRAN/Dropbox/PhD/Research/PhD thesis/Methods/morkov/Utility_study/Graphs/data_5DEC2019.dta") 1 Variables require(ggplot2) ## Loading required package: ggplot2 require(GGally) ## Loading required package: GGally ## Registered S3 method overwritten by 'GGally': ## method from ## +.gg g...
11314 sym R (20192 sym/45 pcs) 7 img
Histogram with R
library(foreign) data=read.dta("C:/Users/BINH THANG-TRAN/Dropbox/PhD/Research/PhD thesis/Methods/morkov/Utility_study/Data_04DEC2019.dta") 1 1. ggplot # add a normal distribution line in histogram hist(data$score2sh, freq=FALSE, col="gray", xlab="Petal Length", main="title here ") curve(dnorm(x, mean=mean(data$score2sh), sd=sd(data$score2sh)),...
1312 sym R (565 sym/4 pcs) 2 img
Survi_K
****if deces: 0=death; 1 alive)************* #Prepare: packages, data library("foreign") library("survival") require("moonBook") ## Loading required package: moonBook require("ztable") ## Loading required package: ztable ## Welcome to package ztable ver 0.2.0 require("magrittr") ## Loading required package: magrittr options(ztable.type="html")...
15464 sym R (70870 sym/165 pcs) 2 img
logistic
#Prepare: packages, data library("foreign") library("survival") require("moonBook") ## Loading required package: moonBook require("ztable") ## Loading required package: ztable ## Welcome to package ztable ver 0.2.0 require("magrittr") ## Loading required package: magrittr options(ztable.type="html") #read data and group for variable Read Data...
908 sym R (29014 sym/71 pcs)