forked from syounkin/ITHIM
-
Notifications
You must be signed in to change notification settings - Fork 1
ITHIM Tutorial
walkabilly edited this page Jan 11, 2018
·
2 revisions
Install the development version of ITHIM using 'devtools'
library("devtools")
install_github("ITHIM/ITHIM", ref="devel")
library("ITHIM")
Next we use three files to create an ITHIM R object.
activeTransportFile <- system.file("activeTravelOHAS.csv", package = "ITHIM")
GBDFile <- system.file("portland-burden-sgy-reformatted.csv", package = "ITHIM")
FFile <- system.file("F.portland.11_21_2017.csv", package = "ITHIM")
ITHIM.baseline <- createITHIM( activeTransportFile = activeTransportFile,
GBDFile = GBDFile,
FFile = FFile )
Now we update the ITHIM object with the mean travel times provided by the transportation modelers, along with: cv (coefficient of variation of active transport time) and muNonTravel (overall mean leisure activity) and cvNonTravel the coefficient of variation for leisure activity.
ITHIM.baseline <- update(ITHIM.baseline, list(
muwt = 47.21,
muct = 15.07,
cv = 1.65,
muNonTravel = 15,
cvNonTravel = 3,
quantiles = c(0.1,0.3,0.5,0.7,0.9)
))
getWalkTime(ITHIM.baseline, form = 1)
getCycleTime(ITHIM.baseline, form = 1)
getMeans(ITHIM.baseline)
ITHIM.baseline
Now we construct four scenarios by updating the mean walk and cycle times.
ITHIM.2027.constrained <- update(ITHIM.baseline, list(muwt = 44.91, muct = 17.82))
ITHIM.2040.nobuild <- update(ITHIM.baseline, list(muwt = 46.21, muct = 17.04))
ITHIM.2040.constrained <- update(ITHIM.baseline, list(muwt = 46.41, muct = 18.85))
ITHIM.2040.strategic <- update(ITHIM.baseline, list(muwt = 46.37, muct = 18.57))
ITHIM.scenario.list <- list(
ITHIM.2027.constrained = ITHIM.2027.constrained,
ITHIM.2040.nobuild = ITHIM.2040.nobuild,
ITHIM.2040.constrained = ITHIM.2040.constrained,
ITHIM.2040.strategic = ITHIM.2040.strategic
)
To tabulate the percent change in disease burden across all scenarios we use the function tabulateResults and output the results to results.csv
results.df <- superTabulate(ITHIM.baseline, ITHIM.scenario.list)
head(results.df)
What do things look like if we set the relative leisure activity mean matrix to 1 and the mean to 1?
One <- matrix(1, ncol = 2, nrow = 8)
muNonTravel <- 1
ITHIM.baseline <- update(ITHIM.baseline, list(muNonTravelMatrix = One, muNonTravel = muNonTravel))
ITHIM.2027.constrained <- update(ITHIM.2027.constrained, list(muNonTravelMatrix = One, muNonTravel = muNonTravel))
ITHIM.2040.nobuild <- update(ITHIM.2040.nobuild, list(muNonTravelMatrix = One, muNonTravel = muNonTravel))
ITHIM.2040.constrained <- update(ITHIM.2040.constrained, list(muNonTravelMatrix = One, muNonTravel = muNonTravel))
ITHIM.2040.strategic <- update(ITHIM.2040.strategic, list(muNonTravelMatrix = One, muNonTravel = muNonTravel))
ITHIM.scenario.list <- list(
ITHIM.2027.constrained = ITHIM.2027.constrained,
ITHIM.2040.nobuild = ITHIM.2040.nobuild,
ITHIM.2040.constrained = ITHIM.2040.constrained,
ITHIM.2040.strategic = ITHIM.2040.strategic
)
results.df <- tabulateResults(ITHIM.baseline, ITHIM.scenario.list)
head(results.df)
What about setting the mean to 10?
muNonTravel <- 10
ITHIM.baseline <- update(ITHIM.baseline, list(muNonTravelMatrix = One, muNonTravel = muNonTravel))
ITHIM.2027.constrained <- update(ITHIM.2027.constrained, list(muNonTravelMatrix = One, muNonTravel = muNonTravel))
ITHIM.2040.nobuild <- update(ITHIM.2040.nobuild, list(muNonTravelMatrix = One, muNonTravel = muNonTravel))
ITHIM.2040.constrained <- update(ITHIM.2040.constrained, list(muNonTravelMatrix = One, muNonTravel = muNonTravel))
ITHIM.2040.strategic <- update(ITHIM.2040.strategic, list(muNonTravelMatrix = One, muNonTravel = muNonTravel))
ITHIM.scenario.list <- list(
ITHIM.2027.constrained = ITHIM.2027.constrained,
ITHIM.2040.nobuild = ITHIM.2040.nobuild,
ITHIM.2040.constrained = ITHIM.2040.constrained,
ITHIM.2040.strategic = ITHIM.2040.strategic
)
results.df <- tabulateResults(ITHIM.baseline, ITHIM.scenario.list)
head(results.df)