R code to run and submit the analysis for the multi-state models project. The code should take about 30 minutes to run. We appreciate your collaboration!
User needs to enter to 4 values noted with "### Enter own value" 1. Local site same ("site_name") 2. Administrative censoring date ("last_date") 3. Directory with the Phase 2.1 LocalPatientSummary.csv file ("dir.LocPatSum") 4. Directory for the output (dir.output)
Note again: Missing values in the LocalPatientSummary.csv should be given "NA"
```{r, echo=TRUE, message=FALSE, warning=FALSE ,include=FALSE}
library(devtools) library(readr) library(mstate) library(dplyr) library(survival) options(kableExtra.latex.load_packages = FALSE) library(kableExtra) library(lubridate) library(tableone) library(papeR) library(rmarkdown)
rm(list=ls())
devtools::install_github("https://github.com/dyhazard/Phase2.1MultStateModPackage", upgrade=FALSE, ref="master", force=T)
site_name <- "Freiburg"
last_date <- "2021-10-31"
dir.LocPatSum <- "/Users/dyhazard/Documents/LocalPatientSummary.csv"
dir.output <- "/Users/dyhazard/Documents/Output"
library(Phase2.1MultStateModPackage)
render(file.path(system.file("rmd", "4CE_Phase21_MSM.Rmd", package = "Phase2.1MultStateModPackage")), output_file = paste(site_name), output_dir = dir.output, envir = parent.frame(), params = list(dir_LPS = dir.LocPatSum, admin_censor = last_date, site_loc = site_name))
final_results <- save_results()
save(final_results ,file = file.path(dir.output, paste(site_name,"_MSM_Results.Rda")))
```
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.