psi.fct: Compute the PSI (pneumonia severity index).

View source: R/psi.fct.R

psi.fctR Documentation

Compute the PSI (pneumonia severity index).

Description

Compute the PSI (pneumonia severity index).

Usage

psi.fct(
  DID_PROBAND,
  FRM_BAS,
  FRM_BEF,
  FRM_B24,
  FRM_RR,
  FRM_O2A,
  FRM_DIL_LABORWERTE,
  FRM_VIS,
  zp_fabian = "d0",
  event2zeitpunkt_df = progressdatenbankderivate::event2zeitpunkt_table
)

Arguments

DID_PROBAND

data.table containing the table with the same name from the database of the PROGRESS study

FRM_BAS

data.table containing the table with the same name from the database of the PROGRESS study

FRM_BEF

data.table containing the table with the same name from the database of the PROGRESS study

FRM_B24

data.table containing the table with the same name from the database of the PROGRESS study

FRM_RR

data.table containing the table with the same name from the database of the PROGRESS study

FRM_O2A

data.table containing the table with the same name from the database of the PROGRESS study

FRM_DIL_LABORWERTE

data.table containing the table with the same name from the database of the PROGRESS study

FRM_VIS

data.table containing the table with the same name from the database of the PROGRESS study

zp_fabian

vector of characters. They must be present in event2zeitpunkt_table$zp_fabianref.

event2zeitpunkt_df

data.table event2zeitpunkt_table (available with the package).

Value

a named list with components: input, input2 and out. out is a data.table with one row corresponding to a combination of PATSTUID (patient) and "EVENT" (time point). Column "psi" contains the PSI values computed by imputing non-critical values, if some components of the score were missing. The column "psi_filt" contains NAs, if any of the components needed for computing the PSI score were missing. The column vollstaendig.von.20 contains information about the number of components having values available out of the overall 20 components of the PSI score.

Examples

## Not run: 
excel_fn <- paste0("/net/ifs1/san_projekte/projekte/",
"PROGRESS/Datenmanagement/Data_freezes/",
"20190320/PROGRESS-freeze_201903_01.xlsx")
DID_PROBAND <- readxl::read_excel(excel_fn, 'DID_PROBAND')
FRM_BAS <- readxl::read_excel(excel_fn, 'FRM_BAS')
FRM_BEF <- readxl::read_excel(excel_fn, 'FRM_BEF')
FRM_B24 <- readxl::read_excel(excel_fn, 'FRM_B24')
FRM_RR <- readxl::read_excel(excel_fn, 'FRM_RR')
FRM_O2A <- readxl::read_excel(excel_fn, 'FRM_O2A')
FRM_DIL_LABORWERTE <- readxl::read_excel(excel_fn, "FRM_DIL_LABORWERTE")
FRM_VIS <- readxl::read_excel(excel_fn, 'FRM_VIS')
data.table::setDT(DID_PROBAND)
data.table::setDT(FRM_BAS)
data.table::setDT(FRM_BEF)
data.table::setDT(FRM_B24)
data.table::setDT(FRM_RR)
data.table::setDT(FRM_O2A)
data.table::setDT(FRM_DIL_LABORWERTE)
data.table::setDT(FRM_VIS)
erg_d0 <- psi.fct(DID_PROBAND, FRM_BAS, FRM_BEF, FRM_B24, FRM_RR, FRM_O2A,
FRM_DIL_LABORWERTE,FRM_VIS, zp_fabian = "d0")
erg_d0
erg_d1 <- psi.fct(DID_PROBAND, FRM_BAS, FRM_BEF, FRM_B24, FRM_RR, FRM_O2A,
FRM_DIL_LABORWERTE,FRM_VIS, zp_fabian = "d1")
erg_d1

## End(Not run)

maciejrosolowski/progressdatenbankderivate documentation built on Nov. 29, 2024, 3:39 a.m.