AddAISSeverityIndicator: Add AIS severity indicator

Description Usage Arguments

View source: R/AddAISSeverityIndicator.R

Description

Adds a variable to the data that indicates if a patient has an abbreviated injury scale (AIS) severity above or equal to a certain cutoff in a certain body region.

Usage

1
2
3
4
5
AddAISSeverityIndicator(study.sample,
  severity.variable.name = "head_and_neck", cutoff = 2,
  levels = c("Yes", "No"),
  variable.name = paste0(severity.variable.name, "geq", cutoff),
  add.as.factor = TRUE, drop.used.variables = FALSE)

Arguments

study.sample

Data frame. The study sample. No default.

severity.variable.name

Character vector of length 1. The name of the variable with AIS severity data. Defaults to "head_and_neck".

cutoff

Numeric vector of length 1. The AIS severity cutoff. Has to be between 1 and 6. Defaults to 2.

levels

Character vector of length 2. The levels to use to encode the resulting indicator variable. The first item in the vector should be the level to be used to indicate that the patient had an injury of the specified severity. Defaults to c("Yes", "No").

variable.name

Character vector of length 1. The name of the resulting variable. Defaults to paste0(severity.variable.name, "geq", cutoff), where geq refers to the Latex command greater than or equal to.

add.as.factor

Logical vector of length 1. If TRUE the indicator variable 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 variables used to calculate the variable is dropped from the sample. Defaults to FALSE.


martingerdin/bengaltiger documentation built on Feb. 29, 2020, 4:46 p.m.