Add24HourInHospitalMortality: Add 24-hour in hospital mortality

Description Usage Arguments

View source: R/Add24HoursInHospitalMortality.R

Description

Adds the variable 24-hour in hospital mortality to the study sample

Usage

1
2
3
4
5
6
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".

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".

add.as.factor

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.


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