View source: R/Add30DayInHospitalMortality.R
Adds the variable 30-day in hospital mortality to the study sample
1 2 3 4 5 6 | Add30DayInHospitalMortality(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 = "m30d", add.as.factor = TRUE,
drop.used.variables = TRUE)
|
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 30-day 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 30-day in hospital mortality variable. Defaults to "m30d". |
add.as.factor |
Logical vector of length 1. If TRUE the 30-day 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 30-day in hospital mortality is dropped from the sample. Defaults to TRUE. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.