View source: R/utils_calculate_champ.R
calculate_champ | R Documentation |
Calculates the CHAMP 30 day mortality risk for the given values. All the variables need to be of the same length. NA values are allowed for *gcs*, *pulse*, *sbp*, *cardiac_rhythm*, and *spo2* as the calculator will automatically select the model fitted for those variables.
calculate_champ(
sbp,
pulse,
spo2,
gcs,
time_from_alarm,
age,
cardiac_rhythm,
medical_facility,
vehicle_ground_unit,
sex_man,
code,
limit_values = TRUE,
errors_as_warnings = FALSE
)
sbp |
Systolic blood pressure (mmHg). Missing values allowed. |
pulse |
Heart rate (bpm). Missing values allowed. |
spo2 |
Oxygen saturation ( Missing values allowed. |
gcs |
Glasgow Coma Scale. Missing values allowed. |
time_from_alarm |
Time from alarm to HEMS arrival (minutes). |
age |
Age in years. |
cardiac_rhythm |
Cardiac rhythm (VF, VT, Asystole, PEA). Missing values allowed. |
medical_facility |
Medical facility or nursing home as TRUE/FALSE or 1/0 |
vehicle_ground_unit |
HEMS vehicle ground unit (vs helicopter) as TRUE/FALSE or 1/0. |
sex_man |
Patient sex male, TRUE/FALSE or 1/0. |
code |
Patient group i.e. "cardiac arrest", "trauma", "respitory failure", "chest pain", "stroke", "neurological", "psychiatric or intoxication", or "other". All other non-missing values are assumed to not be in any of those groups and instead belong to "Gynaecology and obstetrics" and "Infection" groups. |
limit_values |
Should values be winsorized to match the original data set better? Default FALSE. Limits the values below / larger than 0.5th and 99.5th percentiles to the percentile values. Note: Some variables such as *time_from_alarm* can have really long tales in outlier cases leading to questionable risk estimates. |
errors_as_warnings |
Should error's be returned as warnings? Default FALSE. |
Vector of risks for each observation.
calculate_champ(sbp = 100,
pulse = 100,
spo2 = 100,
gcs = 15,
time_from_alarm = 100,
cardiac_rhythm = 1,
age = 20,
medical_facility = 0,
vehicle_ground_unit = 1,
sex_man = 1,
code = "trauma")
calculate_champ(sbp = 100,
pulse = 100,
spo2 = 100,
gcs = 15,
time_from_alarm = 100,
cardiac_rhythm = NA,
age = 20,
medical_facility = 0,
vehicle_ground_unit = 1,
sex_man = 1,
code = "trauma")
calculate_champ(sbp = rep(100, 3),
pulse = rep(100, 3),
spo2 = rep(100, 3),
gcs = rep(15, 3),
time_from_alarm = rep(100, 3),
cardiac_rhythm = rep(NA, 3),
age = rep(20, 3),
medical_facility = rep(0, 3),
vehicle_ground_unit = rep(1, 3),
sex_man = rep(1, 3),
code = rep("trauma", 3))
calculate_champ(sbp = c(100, 200, 300),
pulse = rep(100, 3),
spo2 = rep(100, 3),
gcs = rep(15, 3),
time_from_alarm = rep(100, 3),
cardiac_rhythm = rep(NA, 3),
age = rep(20, 3),
medical_facility = rep(0, 3),
vehicle_ground_unit = rep(1, 3),
sex_man = rep(1, 3),
code = rep("trauma", 3),
limit_values = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.