gen.SORT: A function to compute SORT scores

Description Usage Arguments Value Converting to probability scale References Examples

Description

This function will parse a dataframe and compute morbidity and mortality based on the Surgical Outcome Risk Tool (SORT). To use the function, you will need to manipulate your dataframe to have columns with the structure detailed below.

Usage

1

Arguments

x

A dataframe or tbl where each row is a patient observation, and the columns are SORT predictor variables.

x must contain the following column names (not necessarily in order):

Age

continuous variable, numeric or integer

ASA

categorical variable, can be "I"; "II"; "III"; "IV"; "V"

OpUrgency

categorical variable, NCEPOD classifications, can be "Ele" = Elective; "Exp" = Expedited; "U" = Urgent; "I" = Immediate

Specialty

categorical variable, can be "Ortho" = Orthopaedics; "Colorectal" = Colorectal; "UpperGI" = Upper Gastrointestinal; "Vasc" = Vascular; "Bariatric" = Bariatric; "Other" = All else

OpSeverity

categorical variable, can be "Min" = Minor; "Int" = Intermediate; "Maj" = Major; "Xma" = Xmajor; "Com" = Complex

Malignancy

categorical variable, can be "NM" = Not malignant; "PM" = Primary malignancy only; "MNM" = Malignancy + nodal metastases; "MDM" = Malignancy + distal metastases; Or "Y" / "N"; Or "1" / "0"

Value

A dataframe (or tbl), which you can assign to an object, with the following variables:

SORT_mortLogit

The log-odds for mortality as calculated by SORT

SORT_morbLogit

The log-odds for morbidity as calculated by SORT

Converting to probability scale

The function will produce SORT_mortLogit and SORT_morbLogit values which are on the log-odds scale To convert to probabilities (0 to 1 scale), use arm::invlogit(). See: invlogit.

References

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
#Example of pre-processing to rename data variables to match expected column names
library(tidyverse)

test_data <- raw_data %>%
select(Age = S01Age,
        ASA = S03AsaPsClass,
        OpUrgency = S02OperativeUrgency,
        Specialty = Specialty,
        OpSeverity = S02PlannedProcSeverity,
        Malignancy = S04Malignancy)

## End(Not run)

test_data <- patients
test_output <- gen.SORT(test_data)
head(test_output)

dannyjnwong/HSRC documentation built on May 18, 2019, 2:37 a.m.