Manual

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 25

DownloadManual
Open PDF In BrowserView PDF
Package bengaltiger
March 7, 2019
Title bengaltiger
Version 0.0.24.9000
Description Streamlines data analysis and manuscript writing for medical
research, primarily on the Towards Improved Trauma Care Outcomes (TITCO) in
India cohort.
Depends R (>= 3.3.0)
Imports RMySQL,
rmarkdown,
DBI,
tableone,
knitr
License LICENCE.md
Encoding UTF-8
LazyData true
RoxygenNote 6.1.0

R topics documented:
Add24HourInHospitalMortality . . . . .
Add30DayInHospitalMortality . . . . . .
AddTimeBetweenInjuryAndArrival . . .
AddTimeToFirstVitals . . . . . . . . . .
AddTraumaticBrainInjury . . . . . . . .
AddTriageRevisedTraumaScore . . . . .
AISVariables . . . . . . . . . . . . . . .
CompileResults . . . . . . . . . . . . . .
CreateBootstrapSamples . . . . . . . . .
CreateLogisticRegressionSubTable . . . .
CreateLogisticRegressionTable . . . . . .
CreateSampleCharacteristicsTable . . . .
CreateStudySample . . . . . . . . . . . .
CreateStudyTemplate . . . . . . . . . . .
EstimateInHospitalMortality . . . . . . .
EstimateTraumaticBrainInjuryProportion
GetRevisedTraumaScoreComponents . .
ICDVariables . . . . . . . . . . . . . . .
ImportStudyData . . . . . . . . . . . . .
1

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

2
3
4
5
5
7
7
8
8
9
9
10
11
13
14
15
16
17
17

2

Add24HourInHospitalMortality
ImportTitcoMySQL . . . . . . . . . . . .
Init . . . . . . . . . . . . . . . . . . . . .
IsLength1 . . . . . . . . . . . . . . . . .
LogisticRegression . . . . . . . . . . . .
MergeRoadTrafficInjuryCategories . . . .
OnlyAdolescentsAndYoungAdults . . . .
OnlyIsolatedTraumaticBrainInjuryPatients
OnlyPediatricPatients . . . . . . . . . . .
OnlyPolytraumaPatients . . . . . . . . .
SaveToResults . . . . . . . . . . . . . . .
SourceAdditionalFunctions . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

Index

.
.
.
.
.
.
.
.
.
.
.

18
18
19
20
20
21
21
23
23
24
24
25

Add24HourInHospitalMortality
Add 24-hour in hospital mortality

Description
Adds the variable 24-hour in hospital mortality to the study sample
Usage
Add24HourInHospitalMortality(study.sample, from.date = "doar",
from.time = "toar", to.date = "dodd", to.time = "todd",
date.format = "%Y-%m-%d", time.format = "%H:%M",
died.variable = "died", died.value = "Yes", levels = c("Yes",
"No"), variable.name = "m24h", add.as.factor = TRUE,
drop.used.variables = TRUE)
Arguments
study.sample

Data frame. The study sample. No default.

from.date

Character or POSIXt vector of length 1. The name of the variable with the date
from which to start counting. Defaults to "doar".

from.time

Character or POSIXt vector of length 1. The name of the variable with the time
from which to start counting. Defaults to "toar".

to.date

Character or POSIXt vector of length 1. The name of the variable with the date
from which to start counting. Defaults to "dodd".

to.time

Character or POSIXt vector of length 1. The name of the variable with the time
from which to start counting. Defaults to "todd".

date.format

Character vector of length 1. The date format. Defaults to "%Y-%m-%d".

time.format

Character vector of length 1. The date format. Defaults to "%H:%M".

died.variable

Character vector of length 1. The name of the variable indicating whether the
patient was dead at the end of follow up. Defaults to "died".

died.value

Character vector of length 1. The value or level of the died variable that means
that the patients died. Defaults to "Yes".

Add30DayInHospitalMortality

3

levels

Character vector of length 2. The levels to use to encode the resulting 24-hour
in hospital mortality variable. The first item in the vector should be the level to
be used to represent a death. Defaults to c("Yes", "No").

variable.name

Character vector of length 1. The name of the 24-hour in hospital mortality
variable. Defaults to "m24h".

Logical vector of length 1. If TRUE the 24-hour in hospital mortality variables
is added to the study sample as a factor. If FALSE it is added as character.
Defaults to TRUE.
drop.used.variables
Logical vector of length 1. If TRUE the date and time variables used to calculate
24-hour in hospital mortality is dropped from the sample. Defaults to TRUE.
add.as.factor

Add30DayInHospitalMortality
Add 30-day in hospital mortality

Description
Adds the variable 30-day in hospital mortality to the study sample
Usage
Add30DayInHospitalMortality(study.sample, from.date = "doar",
from.time = "toar", to.date = "dodd", to.time = "todd",
date.format = "%Y-%m-%d", time.format = "%H:%M",
died.variable = "died", died.value = "Yes", levels = c("Yes",
"No"), variable.name = "m30d", add.as.factor = TRUE,
drop.used.variables = TRUE)
Arguments
study.sample

Data frame. The study sample. No default.

from.date

Character or POSIXt vector of length 1. The name of the variable with the date
from which to start counting. Defaults to "doar".

from.time

Character or POSIXt vector of length 1. The name of the variable with the time
from which to start counting. Defaults to "toar".

to.date

Character or POSIXt vector of length 1. The name of the variable with the date
from which to start counting. Defaults to "dodd".

to.time

Character or POSIXt vector of length 1. The name of the variable with the time
from which to start counting. Defaults to "todd".

date.format

Character vector of length 1. The date format. Defaults to "%Y-%m-%d".

time.format

Character vector of length 1. The date format. Defaults to "%H:%M".

died.variable

Character vector of length 1. The name of the variable indicating whether the
patient was dead at the end of follow up. Defaults to "died".

died.value

Character vector of length 1. The value or level of the died variable that means
that the patients died. Defaults to "Yes".

4

AddTimeBetweenInjuryAndArrival
levels

Character vector of length 2. The levels to use to encode the resulting 30-day in
hospital mortality variable. The first item in the vector should be the level to be
used to represent a death. Defaults to c("Yes", "No").

variable.name

Character vector of length 1. The name of the 30-day in hospital mortality variable. Defaults to "m30d".

Logical vector of length 1. If TRUE the 30-day in hospital mortality variables is
added to the study sample as a factor. If FALSE it is added as character. Defaults
to TRUE.
drop.used.variables
Logical vector of length 1. If TRUE the date and time variables used to calculate
30-day in hospital mortality is dropped from the sample. Defaults to TRUE.
add.as.factor

AddTimeBetweenInjuryAndArrival
Add time between injury and arrival

Description
Adds the variable time between injury and arrival to participating centre.
Usage
AddTimeBetweenInjuryAndArrival(study.sample, from.date = "doi",
from.time = "toi", to.date = "doar", to.time = "toar",
date.format = "%Y-%m-%d", time.format = "%H:%M",
units = "hours", variable.name = "tbia",
drop.used.variables = TRUE)
Arguments
study.sample

Data frame. The study sample. No default.

from.date

Character or POSIXt vector of length 1. The name of the variable with the date
from which to start counting. Defaults to "doi".

from.time

Character or POSIXt vector of length 1. The name of the variable with the time
from which to start counting. Defaults to "toi".

to.date

Character or POSIXt vector of length 1. The name of the variable with the date
from which to start counting. Defaults to "doar".

to.time

Character or POSIXt vector of length 1. The name of the variable with the time
from which to start counting. Defaults to "toar".

date.format

Character vector of length 1. The date format. Defaults to "%Y-%m-%d".

time.format

Character vector of length 1. The date format. Defaults to "%H:%M".

units

Character vector of length 1. Should be one of "days", "hours", "minutes", or
"seconds". Defaults to "hours".

Character vector of length 1. The name of the time between injury and arrival
variable. Defaults to "tbia".
drop.used.variables
Logical vector of length 1. If TRUE the date and time variables used to calculate
time between injury and arrival are dropped from the sample. Defaults to TRUE.
variable.name

AddTimeToFirstVitals

5

AddTimeToFirstVitals

Add time to first vitals

Description
Adds the variable time to first vitals, defined as the difference in time between arrival to participating
centre and time when first set of vitals was recorded.
Usage
AddTimeToFirstVitals(study.sample, from.date = "doar",
from.time = "toar", to.date = "dom_1", to.time = "tom_1",
date.format = "%Y-%m-%d", time.format = "%H:%M",
units = "hours", variable.name = "tt1v",
drop.used.variables = TRUE)
Arguments
study.sample

Data frame. The study sample. No default.

from.date

Character or POSIXt vector of length 1. The name of the variable with the date
from which to start counting. Defaults to "doar".

from.time

Character or POSIXt vector of length 1. The name of the variable with the time
from which to start counting. Defaults to "toar".

to.date

Character or POSIXt vector of length 1. The name of the variable with the date
from which to start counting. Defaults to "dom_1".

to.time

Character or POSIXt vector of length 1. The name of the variable with the time
from which to start counting. Defaults to "tom_1".

date.format

Character vector of length 1. The date format. Defaults to "%Y-%m-%d".

time.format

Character vector of length 1. The date format. Defaults to "%H:%M".

units

Character vector of length 1. Should be one of "days", "hours", "minutes", or
"seconds". Defaults to "hours".

Character vector of length 1. The name of the time between injury and arrival
variable. Defaults to "tt1v".
drop.used.variables
Logical vector of length 1. If TRUE the date and time variables used to calculate
time between injury and arrival are dropped from the sample. Defaults to TRUE.
variable.name

AddTraumaticBrainInjury
Add traumatic brain injury

Description
Adds a new indicator variable to the study sample, defining what patients had a traumatic brain
injury (TBI).

6

AddTraumaticBrainInjury

Usage
AddTraumaticBrainInjury(study.sample, icd.codes = c("s02.0", "s02.1",
"s02.7", "s02.8", "s02.9", "s04.0", "s04.1", "s04.2", "s04.3", "s04.4",
"s04.5", "s04.6", "s04.7", "s04.8", "s04.9", "s06.0", "s06.1", "s06.2",
"s06.3", "s06.4", "s06.5", "s06.6", "s06.7", "s06.8", "s06.9", "s07.0",
"s07.1", "s07.8", "s07.9", "s09.7", "s09.8", "s09.9", "t02.0", "t04.0",
"t06.0"), icd.variables = c("e_1_icd", "e_2_icd", "e_3_icd", "e_4_icd",
"e_5_icd", "e_6_icd", "e_7_icd", "e_8_icd", "e_9_icd", "e_10_icd",
"e_11_icd", "e_12_icd", "xray_1_icd", "xray_2_icd", "xray_3_icd",
"xray_4_icd", "xray_5_icd", "xray_6_icd", "xray_7_icd", "xray_8_icd",
"xray_9_icd", "xray_10_icd", "xray_11_icd", "fast_1_icd", "fast_2_icd",
"fast_3_icd", "fast_4_icd", "fast_5_icd", "fast_6_icd", "fast_7_icd",
"fast_8_icd", "fast_9_icd", "fast_10_icd", "fast_11_icd", "ct_1_icd",
"ct_2_icd", "ct_3_icd", "ct_4_icd", "ct_5_icd",
"ct_6_icd",
"ct_7_icd", "ct_8_icd", "ct_9_icd", "ct_10_icd", "ct_11_icd",
"ct_12_icd", "ct_13_icd", "op_1_icd", "op_2_icd", "op_3_icd", "op_4_icd",
"op_5_icd", "op_6_icd", "op_7_icd", "op_8_icd", "op_9_icd", "op_10_icd",
"op_11_icd"), levels = c("Yes", "No"), variable.name = "tbi",
add.as.factor = TRUE, drop.used.variables = TRUE)
Arguments
study.sample

Data frame. The study sample. No default.

icd.codes

Character vector. The codes to be used to define a TBI. If any of the codes is
present in any of the variables listen in icd.variables an observation will be classified as having a TBI. Defaults to c("s02.0", "s02.1", "s02.7", "s02.8", "s02.9",
"s04.0", "s04.1", "s04.2", "s04.3", "s04.4", "s04.5", "s04.6", "s04.7", "s04.8",
"s04.9", "s06.0", "s06.1", "s06.2", "s06.3", "s06.4", "s06.5", "s06.6", "s06.7",
"s06.8", "s06.9", "s07.0", "s07.1", "s07.8", "s07.9", "s09.7", "s09.8", "s09.9",
"t02.0", "t04.0", "t06.0").

icd.variables

Character vector. The names of the variables with international classification of
disease (ICD) codes. Defaults to c("e_1_icd", "e_2_icd", "e_3_icd", "e_4_icd",
"e_5_icd", "e_6_icd", "e_7_icd", "e_8_icd", "e_9_icd", "e_10_icd", "e_11_icd",
"e_12_icd", "xray_1_icd", "xray_2_icd", "xray_3_icd", "xray_4_icd", "xray_5_icd",
"xray_6_icd", "xray_7_icd", "xray_8_icd", "xray_9_icd", "xray_10_icd", "xray_11_icd",
"fast_1_icd", "fast_2_icd", "fast_3_icd", "fast_4_icd", "fast_5_icd", "fast_6_icd",
"fast_7_icd", "fast_8_icd", "fast_9_icd", "fast_10_icd", "fast_11_icd", "ct_1_icd",
"ct_2_icd", "ct_3_icd", "ct_4_icd", "ct_5_icd", "ct_6_icd", "ct_7_icd", "ct_8_icd",
"ct_9_icd", "ct_10_icd", "ct_11_icd", "ct_12_icd", "ct_13_icd", "op_1_icd", "op_2_icd",
"op_3_icd", "op_4_icd", "op_5_icd", "op_6_icd", "op_7_icd", "op_8_icd", "op_9_icd",
"op_10_icd", "op_11_icd").

levels

Character vector of length 2. The levels to use to encode the resulting TBI
variable. The first item in the vector should be the level to be used to represent
a TBI. Defaults to c("Yes", "No").

variable.name

Character vector of length 1. The name of the TBI. Defaults to "tbi".

Logical vector of length 1. If TRUE the TBI is added to the study sample as a
factor. If FALSE it is added as character. Defaults to TRUE.
drop.used.variables
Logical vector of length 1. If TRUE the ICD variables used to calculate TBI is
dropped from the sample. Defaults to TRUE.
add.as.factor

AddTriageRevisedTraumaScore

7

AddTriageRevisedTraumaScore
Add Triage Revised Trauma Score

Description
Add the Triage Revised Trauma Score to the sample
Usage
AddTriageRevisedTraumaScore(study.sample, gcs.name = "gcs_t_1",
sbp.name = "sbp_1", rr.name = "rr_1", variable.name = "trts",
drop.used.variables = FALSE)
Arguments
study.sample

Data frame. The study sample. No default.

gcs.name

Character vector of length 1. The name of the Glasgow coma scale variable.
Defaults to "gcs_t_1".

sbp.name

Character vector of length 1. The name of the systolic blood pressure variable.
Defaults to "sbp_1".

rr.name

Character vector of length 1. The name of the respiratory rate variable. Defaults
to "rr_1".

Character vector of length 1. The name of the triage revised trauma score variable. Defaults to "trts".
drop.used.variables
Logical vector of length 1. If TRUE the date and time variables used to calculate time between injury and arrival are dropped from the sample. Defaults to
FALSE.
variable.name

AISVariables

AIS variables

Description
Returns the names of all AIS variables in the TITCO dataset
Usage
AISVariables()
Examples
AISVariables()

8

CreateBootstrapSamples

CompileResults

Compile results

Description
Compiles the results saved to the results.Rds file and saves it to disk in the format of your choice.
Usage
CompileResults(file.format = "docx", delete.results.file = TRUE)
Arguments
Character vector of length 1. The file format in which to save the results. Must
be one of "md", "pdf", or "docx". Defaults to "docx".
delete.results.file
Logical vector of length 1. If TRUE the results.Rds file is deleted once its content has been compiled and saved. Defaults to TRUE.
file.format

CreateBootstrapSamples
Create bootstrap samples

Description
Creates bootstrap samples and save them to disk, to use in functions that rely on bootstraping to
estimate uncertainty intervals or to come up with other estimators, for example a linear shrinkage
factor.
Usage
CreateBootstrapSamples(study.sample, random.seed.already.set = FALSE,
random.seed = NULL, number.of.bootstrap.samples = 1000)
Arguments
study.sample
Data frame. The study sample. No default.
random.seed.already.set
Logical vector of length 1. If TRUE random.seed does not need to be set within
this function as it indicates that this has been done (which is good practice)
earlier in the code. Defaults to FALSE.
Numeric vector of length 1. Has to be an integer. The seed to use for random
number generation. Only used if random.seed.already.set is FALSE. Defaults to
NULL.
number.of.bootstrap.samples
Numeric vector of length 1. Has to be a positive integer. The number of bootstrap samples to create. Only used it bootstrap.confidence.interval is TRUE.
Defaults to 1000.
random.seed

CreateLogisticRegressionSubTable

9

CreateLogisticRegressionSubTable
Create logistic regression subtable

Description
Creates a subtable for reporting logistic regression results.
Usage
CreateLogisticRegressionSubTable(model.object, odds.ratio = TRUE,
confidence.interval = 0.95, include.intercept = FALSE,
include.p.value = FALSE, digits = 2, verbose = FALSE)
Arguments
model.object

List of class glm. The model object on which to base the table. No default.

Logical vector of length 1. If TRUE odds ratios are reported in the table instead
of coefficients. Defaults to TRUE.
confidence.interval
Numeric vector of length 1. Has to be greater than 0 and less than 1. The width
of the confidence interval. Defaults to 0.95.
include.intercept
Logical vector of length 1. If TRUE the model intercept is reported. Defaults to
FALSE.
include.p.value
Logical vector of length 1. If TRUE the p-value is reported. Defaults to FALSE.
odds.ratio

digits

Numerical vector of length 1. Has to be an integer greater than 0. The number
of digits when reporting results. Defaults to 2.

verbose

Logical vector of length 1. If TRUE progress is printed as the function runs.
Useful for debugging. Defaults to FALSE.

save.table

Logical vector of length 1. If TRUE the table is saved to the results file. Defaults
to TRUE.

table.name

Character vector of length 1 or NULL. The name of the table when saved. Only
used if save.table is TRUE, in which case table.name cannot be NULL. Defaults
to NULL.

CreateLogisticRegressionTable
Create logistic regression table

Description
Creates a table for reporting logistic regression results.

10

CreateSampleCharacteristicsTable

Usage
CreateLogisticRegressionTable(model.list, odds.ratio = TRUE,
confidence.interval = 0.95, include.intercept = FALSE,
include.p.value = FALSE, digits = 2, save.table = TRUE,
table.name = NULL, verbose = FALSE)
Arguments
model.list

List. The model objects on which to base the table. No default.

Logical vector of length 1. If TRUE odds ratios are reported in the table instead
of coefficients. Defaults to TRUE.
confidence.interval
Numeric vector of length 1. Has to be greater than 0 and less than 1. The width
of the confidence interval. Defaults to 0.95.
include.intercept
Logical vector of length 1. If TRUE the model intercept is reported. Defaults to
FALSE.
include.p.value
Logical vector of length 1. If TRUE the p-value is reported. Defaults to FALSE.
odds.ratio

digits

Numerical vector of length 1. Has to be an integer greater than 0. The number
of digits when reporting results. Defaults to 2.

save.table

Logical vector of length 1. If TRUE the table is saved to the results file. Defaults
to TRUE.

table.name

Character vector of length 1 or NULL. The name of the table when saved. Only
used if save.table is TRUE, in which case table.name cannot be NULL. Defaults
to NULL.

verbose

Logical vector of length 1. If TRUE progress is printed as the function runs.
Useful for debugging. Defaults to FALSE.

CreateSampleCharacteristicsTable
Create sample characteristics table

Description
Creates the sample characteristics table. Wrapper of TableOne.
Usage
CreateSampleCharacteristicsTable(study.sample, data.dictionary = NULL,
group = NULL, variables = NULL, exclude.variables = NULL,
include.overall = TRUE, include.missing = TRUE,
include.complete.data = FALSE, digits = 1, save.to.results = TRUE,
table.name = "sample.characteristics.table",
table.caption = "Sample characteristics", save.to.disk = FALSE,
file.format = "docx")

CreateStudySample

11

Arguments
study.sample

Data frame. The study sample. No default.

data.dictionary
Not currently used.
group

Character vector of length 1. The grouping variable. If NULL the table is not
grouped. Defaults to NULL.

variables

Character vector. The names of variables to include in the table. If NULL all
variables in data.dictionary is included. Defaults to NULL.

exclude.variables
Character vector. The names of variables to exclude from the table. If NULL no
variables are excluded. Defaults to NULL.
include.overall
Logical vector of length 1. If TRUE an overall column is included in the tables.
Used only if group is not NULL. Defaults to TRUE.
include.missing
Not currently used. Logical vector of length 1. If TRUE a column with the
number ( included. Defaults to TRUE.
include.complete.data
Logical vector of length 1. If TRUE the final table has two columns, one with
complete cases only and one with multiple imputed data. Only used if the data
is detected as multiple imputed, i.e. includes the variables ".imp" AND ".id".
Overrides group and include.overall.
digits

Numeric vector of length 1 greater than or equal to 0. Number of digits to use
when rounding table entries. Defaults to 1.

save.to.results
Logical vector of length 1. If TRUE the table object is saved to a results file on
disk using SaveToResults. Defaults to TRUE.
table.name

Character vector of length 1. The name of the table when passed to SaveToResults. Deafults to "sample.characteristics.table".

table.caption

Character vector of length 1. The table caption. Deafults to "Sample characteristics".

save.to.disk

Logical vector of length 1. If TRUE the table object is saved to disk. Defaults
to FALSE.

file.format

Character vector of length 1. The format in which to save the table to disk. Has
to be one of c("pdf", "rmd", "docx"). Defaults to "docx".

CreateStudySample

Create study sample

Description
Creates the study sample using a list of inclusion criteria. Note that the selection process is stepwise
in the order given by the inclusion criteria.

12

CreateStudySample

Usage
CreateStudySample(study.data, inclusion.criteria, complete.cases = TRUE,
relevant.variables = c("hos", "sex", "tran", "doi", "toi", "doar",
"toar", "dodd", "todd", "moi", "age", "sbp_1", "hr_1", "rr_1", "gcs_t_1",
"iss", "died", "head_and_neck", "face", "chest", "extremities",
"external", "e_1_icd", "e_2_icd", "e_3_icd", "e_4_icd", "e_5_icd",
"e_6_icd", "e_7_icd", "e_8_icd", "e_9_icd", "e_10_icd", "e_11_icd",
"e_12_icd", "xray_1_icd", "xray_2_icd", "xray_3_icd", "xray_4_icd",
"xray_5_icd", "xray_6_icd", "xray_7_icd", "xray_8_icd", "xray_9_icd",
"xray_10_icd", "xray_11_icd", "fast_1_icd",
"fast_2_icd",
"fast_3_icd", "fast_4_icd", "fast_5_icd", "fast_6_icd", "fast_7_icd",
"fast_8_icd", "fast_9_icd", "fast_10_icd", "fast_11_icd", "ct_1_icd",
"ct_2_icd", "ct_3_icd", "ct_4_icd", "ct_5_icd", "ct_6_icd", "ct_7_icd",
"ct_8_icd", "ct_9_icd", "ct_10_icd", "ct_11_icd", "ct_12_icd",
"ct_13_icd", "op_1_icd", "op_2_icd", "op_3_icd", "op_4_icd", "op_5_icd",
"op_6_icd", "op_7_icd", "op_8_icd", "op_9_icd", "op_10_icd",
"op_11_icd"), add.to.relevant.variables = NULL,
remove.from.relevant.variables = NULL,
ignore.variables = c("head_and_neck", "face", "chest", "extremities",
"external", "e_1_icd", "e_2_icd", "e_3_icd", "e_4_icd", "e_5_icd",
"e_6_icd", "e_7_icd", "e_8_icd", "e_9_icd", "e_10_icd", "e_11_icd",
"e_12_icd", "xray_1_icd", "xray_2_icd", "xray_3_icd", "xray_4_icd",
"xray_5_icd", "xray_6_icd", "xray_7_icd", "xray_8_icd", "xray_9_icd",
"xray_10_icd", "xray_11_icd", "fast_1_icd", "fast_2_icd", "fast_3_icd",
"fast_4_icd", "fast_5_icd", "fast_6_icd", "fast_7_icd", "fast_8_icd",
"fast_9_icd", "fast_10_icd", "fast_11_icd",
"ct_1_icd", "ct_2_icd",
"ct_3_icd", "ct_4_icd", "ct_5_icd", "ct_6_icd", "ct_7_icd", "ct_8_icd",
"ct_9_icd", "ct_10_icd", "ct_11_icd", "ct_12_icd", "ct_13_icd",
"op_1_icd", "op_2_icd", "op_3_icd", "op_4_icd", "op_5_icd", "op_6_icd",
"op_7_icd", "op_8_icd", "op_9_icd", "op_10_icd", "op_11_icd"),
save.to.results = TRUE, save.to.disk = FALSE, file.format = "docx",
override = TRUE)
Arguments
study.data
Data frame. The study data. No defaults.
inclusion.criteria
A list of functions. Each function should represent an inclusion criterion. No
default.
complete.cases Logical vector of length 1. If TRUE only complete cases will be returned. If
FALSE all cases are returned. Defaults to TRUE.
relevant.variables
Character vector. The names of variables to keep in the study sample. Defaults
to c("hos", "sex", "tran", "doi", "toi", "doar", "toar", "dodd", "todd", "moi",
"age", "sbp_1", "hr_1", "rr_1", "gcs_t_1", "iss", "died", "head_and_neck", "face",
"chest", "extremities", "external", "e_1_icd", "e_2_icd", "e_3_icd", "e_4_icd",
"e_5_icd", "e_6_icd", "e_7_icd", "e_8_icd", "e_9_icd", "e_10_icd", "e_11_icd",
"e_12_icd", "xray_1_icd", "xray_2_icd", "xray_3_icd", "xray_4_icd", "xray_5_icd",
"xray_6_icd", "xray_7_icd", "xray_8_icd", "xray_9_icd", "xray_10_icd", "xray_11_icd",
"fast_1_icd", "fast_2_icd", "fast_3_icd", "fast_4_icd", "fast_5_icd", "fast_6_icd",
"fast_7_icd", "fast_8_icd", "fast_9_icd", "fast_10_icd", "fast_11_icd", "ct_1_icd",
"ct_2_icd", "ct_3_icd", "ct_4_icd", "ct_5_icd", "ct_6_icd", "ct_7_icd", "ct_8_icd",

CreateStudyTemplate

13

"ct_9_icd", "ct_10_icd", "ct_11_icd", "ct_12_icd", "ct_13_icd", "op_1_icd", "op_2_icd",
"op_3_icd", "op_4_icd", "op_5_icd", "op_6_icd", "op_7_icd", "op_8_icd", "op_9_icd",
"op_10_icd", "op_11_icd").
add.to.relevant.variables
Character vector. The names of variables to add to the default variables in relevant.variables. If NULL no variables are added. Defaults to NULL.
remove.from.relevant.variables
Character vector. The names of variables to remove from the default variables
in relevant.variables. If NULL no variables are removed. Defaults to NULL.
ignore.variables
Character vector. The names of variables to ignore when complete cases are determined. The variables included in this vector must also be in relevant.variables.
If NULL no variables are ignored. Defaults to c("head_and_neck", "face",
"chest", "extremities", "external", "e_1_icd", "e_2_icd", "e_3_icd", "e_4_icd",
"e_5_icd", "e_6_icd", "e_7_icd", "e_8_icd", "e_9_icd", "e_10_icd", "e_11_icd",
"e_12_icd", "xray_1_icd", "xray_2_icd", "xray_3_icd", "xray_4_icd", "xray_5_icd",
"xray_6_icd", "xray_7_icd", "xray_8_icd", "xray_9_icd", "xray_10_icd", "xray_11_icd",
"fast_1_icd", "fast_2_icd", "fast_3_icd", "fast_4_icd", "fast_5_icd", "fast_6_icd",
"fast_7_icd", "fast_8_icd", "fast_9_icd", "fast_10_icd", "fast_11_icd", "ct_1_icd",
"ct_2_icd", "ct_3_icd", "ct_4_icd", "ct_5_icd", "ct_6_icd", "ct_7_icd", "ct_8_icd",
"ct_9_icd", "ct_10_icd", "ct_11_icd", "ct_12_icd", "ct_13_icd", "op_1_icd", "op_2_icd",
"op_3_icd", "op_4_icd", "op_5_icd", "op_6_icd", "op_7_icd", "op_8_icd", "op_9_icd",
"op_10_icd", "op_11_icd").
save.to.results
Logical vector of length 1. If TRUE the output is saved to a results file on disk.
Defaults to TRUE.
save.to.disk
Logical vector of length 1. If TRUE a file named "exclusions_and_missingness"
is saved to disk where the exclusions and missingness are described. Defaults to
FALSE.
file.format
Character vector of length 1. Has to be either "docx" or "rmd". The format
in which the file detailing the exclusions and missingness is saved. Defaults to
"docx".
override
Logical vector of length 1. If TRUE the file "exclusions_and_missingness" is
replaced if it exists. If FALSE the function aborts if the file exists. Defaults to
TRUE.

CreateStudyTemplate

Create study template

Description
Creates a .R file with a custom name where all study steps are documented and run.
Usage
CreateStudyTemplate(study.name = "My bengaltiger study",
authors = "Firstname Lastname",
description = "This is a bengaltiger study.", file.name = "RunStudy",
path = ".", create.directory = FALSE,
functions.to.include = c("ImportStudyData"), save.as.function = TRUE,
function.name = file.name, open = TRUE)

14

EstimateInHospitalMortality

Arguments
study.name

Character vector of length 1. The name of the study. Defaults to "My bengaltiger
study".

authors

Character vector. The names of the study authors. Defaults to c("Firstname
Lastname").

description

Character vector of length 1. Short description of the study. Defaults to "This is
a bengaltiger study.".

file.name

Character vector of length 1. The file name. Defaults to "RunStudy".

Character vector of length 1. The path where the study template is saved. Defaults to ".", i.e. the current working directory.
create.directory
Logical vector of length 1. If TRUE the directory to which path is pointing is
created using dir.create(path) if it does not already exist. Defaults to FALSE.
functions.to.include
Character vector. The names of the functions to include in the template. Defaults
to c("ImportsStudyData").
save.as.function
Logical vector of length 1. If TRUE the study template is structured as a R
function. Defaults to TRUE.
path

function.name

Character vector of length 1. The name of the study function. Is used only if
as.functions = TRUE. Defaults to file.name.

open

Logical vector of length 1. If TRUE the study template file is opened using R’s
file.edit(). Defaults to TRUE.

EstimateInHospitalMortality
Estimate in hospital mortality

Description
Estimates the proportion of patients who died in hospital with a bootstrap confidence interval if
requested.
Usage
EstimateInHospitalMortality(study.sample, variable.name = "m24h",
died.level = "Yes", digits = 3,
bootstrap.confidence.interval = TRUE,
bootstrap.samples.exist = FALSE, random.seed.already.set = FALSE,
random.seed = NULL, number.of.bootstrap.samples = 1000,
save.to.results = TRUE, print.result = TRUE, return.result = FALSE)
Arguments
study.sample

Data frame. The study sample. No default.

variable.name

Character vector of length 1. The name of the in hospital mortality variable.
Defaults to "m24h".

EstimateTraumaticBrainInjuryProportion
died.level

15

Character vector of length 1. The level of the in hospital mortality variable that
indicates in hospital mortality. Defaults to "Yes".

Numeric vector of length 1. Must be a positive integer. The number of digits to
use when rounding the proportion, and if applicable, the lower and upper bounds
of the confidence interval. Defaults to 3.
bootstrap.confidence.interval
Logical vector of length 1. If TRUE a confidence interval is estimated using an
emperical bootstrap. Deafults to TRUE.
digits

bootstrap.samples.exist
Logical vector of length 1. If TRUE bootstrap samples are assumed to have
been created using CreateBootstrapSamples, and are therefore read from the file
bootstrap.samples.Rds. Defaults to FALSE.
random.seed.already.set
Logical vector of length 1. If TRUE random.seed does not need to be set within
this function as it indicates that this has been done (which is good practice)
earlier in the code. Defaults to FALSE.
random.seed

Numeric vector of length 1. Has to be an integer. The seed to use for random
number generation. Only used if bootstrap.conficence.interval is TRUE and random.seed.already.set is FALSE. Defaults to NULL.

number.of.bootstrap.samples
Numeric vector of length 1. Has to be a positive integer. The number of bootstrap samples to use. Only used it bootstrap.confidence.interval is TRUE. Defaults to 1000.
save.to.results
Logical vector of length 1. If TRUE the table object is saved to a results file on
disk using SaveToResults. Defaults to TRUE.
print.result

Logical vector of length 1. If TRUE the result is printed so that you see what is
saved to results. Defaults to TRUE.

return.result

Logical vector of length 1. If TRUE the result is returned to the parent environment. Default to FALSE.

EstimateTraumaticBrainInjuryProportion
Estimate traumatic brain injury proportion

Description
Estimates the proportion of patients with traumatic brain injury.
Usage
EstimateTraumaticBrainInjuryProportion(study.sample,
variable.name = "tbi", tbi.level = "Yes", digits = 3,
bootstrap.confidence.interval = TRUE, random.seed = NULL,
number.of.bootstrap.samples = 1000, save.to.disk = TRUE,
return.result = FALSE)

16

GetRevisedTraumaScoreComponents

Arguments
study.sample

Data frame. The study sample. No default.

variable.name

Character vector of length 1. The name of the traumatic brain injury variable.
Defaults to "tbi".

tbi.level

Character vector of length 1. The level of the traumatic brain injury variable that
indicates a traumatic brain injury. Defaults to "Yes".

Numeric vector of length 1. Must be a positive integer. The number of digits to
use when rounding the proportion, and if applicable, the lower and upper bounds
of the confidence interval. Defaults to 3.
bootstrap.confidence.interval
Logical vector of length 1. If TRUE a confidence interval is estimated using an
emperical bootstrap. Deafults to TRUE.
digits

Numeric vector of length 1. Has to be an integer. The seed to use for random number generation. Only used if bootstrap.conficence.interval is TRUE.
Defaults to NULL.
number.of.bootstrap.samples
Numeric vector of length 1. Has to be a positive integer. The number of bootstrap samples to use. Only used it bootstrap.confidence.interval is TRUE. Defaults to 1000.
random.seed

save.to.disk

Logical vector of length 1. If TRUE the result is saved to disk in "results.rmd".
Defaults to TRUE.

return.result

Logical vector of length 1. If TRUE the result is returned to the parent environment. Default to FALSE.

GetRevisedTraumaScoreComponents
Get revised trauma score components

Description
Gets revised trauma score components
Usage
GetRevisedTraumaScoreComponents(study.sample, gcs.name = "gcs_t_1",
sbp.name = "sbp_1", rr.name = "rr_1")
Arguments
study.sample

Data frame. The study sample. No default.

gcs.name

Character vector of length 1. The name of the Glasgow coma scale variable.
Defaults to "gcs_t_1".

sbp.name

Character vector of length 1. The name of the systolic blood pressure variable.
Defaults to "sbp_1".

rr.name

Character vector of length 1. The name of the respiratory rate variable. Defaults
to "rr_1".

ICDVariables

ICDVariables

17

ICD variables

Description
Returns the names of ICD 10 variables in the TITCO dataset
Usage
ICDVariables(subset = "all")
Arguments
subset

Character vector. Must be one or more of "all", "external", "xray", "fast", "ct",
"intraoperative". Defaults "all", which is equal to c("external", "xray", "fast",
"ct", "intraoperative").

Examples
ICDVariables()
ICDVariables("external")
ICDVariables(c("xray", "ct"))

ImportStudyData

Import study data

Description
Imports the study data from a csv file.
Usage
ImportStudyData(data.file.name = NULL, data.path = "./data/")
Arguments
data.file.name Character vector of length 1. The name of the study data file. Defaults to NULL.
data.path

Character vector of length 1. The path to the data directory. Defaults to "./data/"

18

Init

ImportTitcoMySQL

Import titco study data from mysql server

Description
Imports the titco study data from a mysql server, if no arguments are set, defaults to mangrove SSH
tunnel-configuration.
Usage
ImportTitcoMySQL(mysql.server.name = "127.0.0.1",
mysql.server.port = 3307, mysql.database = "TITCO",
mysql.username = "titco", mysql.password = "mangrovetitco",
mysql.titco.table = "titco")
Arguments
mysql.server.name
Character vector of length 1. The hostname or IP of the mysql-server, defaults
to 127.0.0.1.
mysql.server.port
Integer. The port of mysql-server, defaults is 3307.
mysql.database Character vector of length 1. The name of the database, defaults to TITCO
mysql.username Character vector of length 1. The username for the database, defaults to titco.
mysql.password Character vector of length 1. Password for db access, defaults to mangrovetitco
mysql.titco.table
Character vector of length 1. The mysql table name, defaults to titco. To use the
smaller sample data set, set this to titco_sample

Init

Initiate a bengaltiger study

Description
Initiates a bengeltiger study by creating a standard directory structure and study template.
Usage
Init(create.study.template = TRUE, study.name = "My bengaltiger study",
authors = "Firstname Lastname",
description = "This is a bengaltiger study.", file.name = "RunStudy",
path = ".", create.directory = FALSE,
functions.to.include = c("ImportStudyData"), save.as.function = TRUE,
function.name = file.name, open = TRUE)

IsLength1

19

Arguments
create.study.template
Logical vector of length 1. If TRUE a study template will be created in the
current working directory. Defaults to TRUE.
study.name

Character vector of length 1. The name of the study. Defaults to "My bengaltiger
study".

authors

Character vector. The names of the study authors. Defaults to c("Firstname
Lastname").

description

Character vector of length 1. Short description of the study. Defaults to "This is
a bengaltiger study.".

file.name

Character vector of length 1. The file name. Defaults to "RunStudy".

path

Character vector of length 1. The path where the study template is saved. Defaults to ".", i.e. the current working directory.

create.directory
Logical vector of length 1. If TRUE the directory to which path is pointing is
created using dir.create(path) if it does not already exist. Defaults to FALSE.
functions.to.include
Character vector. The names of the functions to include in the template. Defaults
to c("ImportsStudyData").
save.as.function
Logical vector of length 1. If TRUE the study template is structured as a R
function. Defaults to TRUE.
function.name

Character vector of length 1. The name of the study function. Is used only if
as.functions = TRUE. Defaults to file.name.

open

Logical vector of length 1. If TRUE the study template file is opened using R’s
file.edit(). Defaults to TRUE.

IsLength1

Is length 1

Description
Checks if a given object is a non-list vector of length 1
Usage
IsLength1(x)
Arguments
x

A vector. The object to be checked. No default.

20

MergeRoadTrafficInjuryCategories

LogisticRegression

Logistic regression

Description
Runs a logistic regression.
Usage
LogisticRegression(study.sample, outcome.name, covariate.names,
run.bivariable.analyses = FALSE, stop.if.missing = TRUE,
create.table = TRUE, table.options = list(odds.ratio = TRUE,
confidence.interval = 0.95, include.p.value = FALSE, digits = 2,
save.table = TRUE, table.name = NULL, verbose = FALSE),
verbose = FALSE)
Arguments
study.sample

Data frame. The study sample. No default.

outcome.name
Character vector of length 1. The name of the outcome variable. No default.
covariate.names
Character vector. The names of the covariates. No default.
run.bivariable.analyses
Logical vector of length 1. If TRUE bivariable analyses are run before the full
model is run and these results are included in the final table as unadjusted estimates. Defaults to FALSE.
stop.if.missing
Logical vector of length 1. If TRUE the execution stops if there is missing data
in the outcome or covariates. Defaults to TRUE.
create.table

Logical vector of length 1. If TRUE a table with the regression results is created
and returned. The apperance of this table can be modified using table.options.
If FALSE the model object is returned. Defaults to TRUE.

table.options

List. Can only include "odds.ratio", "confidence.interval", "include.intercept",
"include.p.value", "digits", "save.table", "table.name", and "verbose". See ?CreateLogisticRegressionTable for details.

verbose

Logical vector of length 1. If TRUE progress is printed as the function runs.
Useful for debugging. Defaults to FALSE.

MergeRoadTrafficInjuryCategories
Merge road traffic injury categories

Description
Merges road traffic injury categories into one
Usage
MergeRoadTrafficInjuryCategories(study.sample, variable.name = "moi")

OnlyAdolescentsAndYoungAdults

21

Arguments
study.sample

Data frame. The study sample. No default.

variable.name

Character vector of length 1. The name of the mechanism of injury variable.
Defaults to "moi".

OnlyAdolescentsAndYoungAdults
Only adolescents and young adults

Description
Keeps only the adolescents and young adults.
Usage
OnlyAdolescentsAndYoungAdults(study.sample, age.variable.name = "age",
lower.age.cutoff = 10, upper.age.cutoff = 24,
remove.missing = TRUE)
Arguments
study.sample
Data frame. The study sample. No default.
age.variable.name
Character vector of length 1. The name of the age variable. Defaults to "age".
lower.age.cutoff
Numeric vector of length 1. The lower age cutoff. Defaults to 10, i.e. only
observations with an age of at least ten and at most upper.age.cutoff are kept in
the sample.
upper.age.cutoff
Numeric vector of length 1. The upper age cutoff. Defaults to 24, i.e. only
observations with an age of at least lower.age.cutoff and at most 24 are kept in
the sample.
remove.missing Logical vector of length 1. If TRUE all observations with missing age, as detected by is.na, are removed from the sample. Defaults to TRUE.

OnlyIsolatedTraumaticBrainInjuryPatients
Only isolated traumatic brain injury patients

Description
Keeps only the isolated traumatic brain injury (TBI) patients. Isolated traumatic brain injury is
here defined as having any of the international classification of disease (ICD) codes listed in the
parameter icd.codes below and no abbreviated injury scale (AIS) score >1 in any other body region.

22

OnlyIsolatedTraumaticBrainInjuryPatients

Usage
OnlyIsolatedTraumaticBrainInjuryPatients(study.sample,
icd.codes = c("s02.0", "s02.1", "s02.7", "s02.8", "s02.9", "s04.0",
"s04.1", "s04.2", "s04.3", "s04.4", "s04.5", "s04.6", "s04.7", "s04.8",
"s04.9", "s06.0", "s06.1", "s06.2", "s06.3", "s06.4", "s06.5", "s06.6",
"s06.7", "s06.8", "s06.9", "s07.0", "s07.1", "s07.8", "s07.9", "s09.7",
"s09.8", "s09.9", "t02.0", "t04.0", "t06.0"),
icd.variables = c("e_1_icd", "e_2_icd", "e_3_icd", "e_4_icd",
"e_5_icd", "e_6_icd", "e_7_icd", "e_8_icd", "e_9_icd", "e_10_icd",
"e_11_icd", "e_12_icd", "xray_1_icd", "xray_2_icd", "xray_3_icd",
"xray_4_icd", "xray_5_icd", "xray_6_icd", "xray_7_icd", "xray_8_icd",
"xray_9_icd", "xray_10_icd", "xray_11_icd", "fast_1_icd", "fast_2_icd",
"fast_3_icd", "fast_4_icd", "fast_5_icd", "fast_6_icd", "fast_7_icd",
"fast_8_icd", "fast_9_icd", "fast_10_icd", "fast_11_icd", "ct_1_icd",
"ct_2_icd", "ct_3_icd", "ct_4_icd", "ct_5_icd",
"ct_6_icd",
"ct_7_icd", "ct_8_icd", "ct_9_icd", "ct_10_icd", "ct_11_icd",
"ct_12_icd", "ct_13_icd", "op_1_icd", "op_2_icd", "op_3_icd", "op_4_icd",
"op_5_icd", "op_6_icd", "op_7_icd", "op_8_icd", "op_9_icd", "op_10_icd",
"op_11_icd"), ais.variables = c("face", "chest", "extremities",
"external"), ais.cutoff = 1, remove.missing = FALSE)
Arguments
study.sample

Data frame. The study sample. No default.

icd.codes

Character vector. The codes to be used to define a TBI. If any of the codes is
present in any of the variables listen in icd.variables an observation will be classified as having a TBI. Defaults to c("s02.0", "s02.1", "s02.7", "s02.8", "s02.9",
"s04.0", "s04.1", "s04.2", "s04.3", "s04.4", "s04.5", "s04.6", "s04.7", "s04.8",
"s04.9", "s06.0", "s06.1", "s06.2", "s06.3", "s06.4", "s06.5", "s06.6", "s06.7",
"s06.8", "s06.9", "s07.0", "s07.1", "s07.8", "s07.9", "s09.7", "s09.8", "s09.9",
"t02.0", "t04.0", "t06.0").

icd.variables

Character vector. The names of the variables with international classification of
disease (ICD) codes. Defaults to c("e_1_icd", "e_2_icd", "e_3_icd", "e_4_icd",
"e_5_icd", "e_6_icd", "e_7_icd", "e_8_icd", "e_9_icd", "e_10_icd", "e_11_icd",
"e_12_icd", "xray_1_icd", "xray_2_icd", "xray_3_icd", "xray_4_icd", "xray_5_icd",
"xray_6_icd", "xray_7_icd", "xray_8_icd", "xray_9_icd", "xray_10_icd", "xray_11_icd",
"fast_1_icd", "fast_2_icd", "fast_3_icd", "fast_4_icd", "fast_5_icd", "fast_6_icd",
"fast_7_icd", "fast_8_icd", "fast_9_icd", "fast_10_icd", "fast_11_icd", "ct_1_icd",
"ct_2_icd", "ct_3_icd", "ct_4_icd", "ct_5_icd", "ct_6_icd", "ct_7_icd", "ct_8_icd",
"ct_9_icd", "ct_10_icd", "ct_11_icd", "ct_12_icd", "ct_13_icd", "op_1_icd", "op_2_icd",
"op_3_icd", "op_4_icd", "op_5_icd", "op_6_icd", "op_7_icd", "op_8_icd", "op_9_icd",
"op_10_icd", "op_11_icd").

ais.variables

Character vector. The names of the variables with AIS scores for each body region. Defaults to c("head_and_neck", "face", "chest", "extremities", "external").

ais.cutoff

Integer vector of length 1 between 1 and 6. The cutoff above which an injury
should not be included as isolated TBI. Defaults to 1.

remove.missing Logical vector of length 1. If TRUE all observations with missing AIS, as detected by is.na, are removed from the sample. Defaults to FALSE.

OnlyPediatricPatients

23

OnlyPediatricPatients Only pediatric patients

Description
Keeps only the pediatric patients in the sample.
Usage
OnlyPediatricPatients(study.sample, age.variable.name = "age",
age.cutoff = 18, remove.missing = TRUE)
Arguments
study.sample
Data frame. The study sample. No default.
age.variable.name
Character vector of length 1. The name of the age variable. Defaults to "age".
age.cutoff

Numeric vector of length 1. The age cutoff. Defaults to 18, i.e. only observations with an age less than 18 are kept in the sample.

remove.missing Logical vector of length 1. If TRUE all observations with missing age, as detected by is.na, are removed from the sample. Defaults to TRUE.

OnlyPolytraumaPatients
Only polytrauma patients

Description
Keeps only the polytrauma patients. Polytrauma is here defined as at least two injuries scored above
a certain abbreviated injury scale (AIS) score cutoff in at least two different body regions.
Usage
OnlyPolytraumaPatients(sample, ais.variables = c("head_and_neck", "face",
"chest", "extremities", "external"), ais.cutoff = 2,
remove.missing = FALSE)
Arguments
sample

Data frame. The study sample. No default.

ais.variables

Character vector. The names of the variables with AIS scores for each body region. Defaults to c("head_and_neck", "face", "chest", "extremities", "external").

ais.cutoff

Integer vector of length 1 between 1 and 6. The cutoff above which an injury is
counted for polytrauma. Defaults to 2.

remove.missing Logical vector of length 1. If TRUE all observations with missing AIS, as detected by is.na, are removed from the sample. Defaults to FALSE.

24

SourceAdditionalFunctions

SaveToResults

Save to results

Description
Saves the desired output to a results file in the current working directory. Output saved in this file
can later be compiled as a document.
Usage
SaveToResults(output.object, object.name, overwrite = TRUE)
Arguments
output.object

Any object. The output to be saved. Most often you want this to be a character
vector of length 1, why you will see a warning if it is something else. No default.

object.name

Character vector of length 1. The name of the output object in the results object.
No default.

overwrite

Logical vector of length 1. If TRUE any entry in the results object with the same
name as object.name is overwritten. Defaults to TRUE.

SourceAdditionalFunctions
Source additional functions

Description
Sources additional functions for use within the project. These functions may be user written and
intended only for this specific projects, or they may be functions that are yet to be added to the
package.
Usage
SourceAdditionalFunctions(path = "./misc/R/")
Arguments
path

Character vector of length 1. The path to the directory that holds the additional
functions. Defaults to "./misc/R/".

Index
Add24HourInHospitalMortality, 2
Add30DayInHospitalMortality, 3
AddTimeBetweenInjuryAndArrival, 4
AddTimeToFirstVitals, 5
AddTraumaticBrainInjury, 5
AddTriageRevisedTraumaScore, 7
AISVariables, 7
CompileResults, 8
CreateBootstrapSamples, 8
CreateLogisticRegressionSubTable, 9
CreateLogisticRegressionTable, 9
CreateSampleCharacteristicsTable, 10
CreateStudySample, 11
CreateStudyTemplate, 13
EstimateInHospitalMortality, 14
EstimateTraumaticBrainInjuryProportion,
15
GetRevisedTraumaScoreComponents, 16
ICDVariables, 17
ImportStudyData, 17
ImportTitcoMySQL, 18
Init, 18
IsLength1, 19
LogisticRegression, 20
MergeRoadTrafficInjuryCategories, 20
OnlyAdolescentsAndYoungAdults, 21
OnlyIsolatedTraumaticBrainInjuryPatients,
21
OnlyPediatricPatients, 23
OnlyPolytraumaPatients, 23
SaveToResults, 24
SourceAdditionalFunctions, 24

25



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.5
Linearized                      : No
Page Count                      : 25
Page Mode                       : UseOutlines
Author                          : 
Title                           : 
Subject                         : 
Creator                         : LaTeX with hyperref package
Producer                        : pdfTeX-1.40.17
Create Date                     : 2019:03:07 15:40:58+01:00
Modify Date                     : 2019:03:07 15:40:58+01:00
Trapped                         : False
PTEX Fullbanner                 : This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) kpathsea version 6.2.2
EXIF Metadata provided by EXIF.tools

Navigation menu