derive_var_ady: Derive Analysis Study Day

Description Usage Arguments Details Value Author(s) Examples

View source: R/derive_var_ady.R

Description

[Questioning]

Adds the analysis study day (ADY) to the dataset, i.e., study day of analysis date.

Usage

1
derive_var_ady(dataset, reference_date = TRTSDT, date = ADT)

Arguments

dataset

Input dataset

The columns specified by the reference_date and the date parameter are expected.

reference_date

The start date column, e.g., date of first treatment

A date or date-time object column is expected.

The default is TRTSDT.

date

The end date column for which the study day should be derived

A date or date-time object column is expected.

The default is ADT

Details

The study day is derived as number of days from the start date to the end date. If it is non-negative, one is added. I.e., the study day of the start date is 1.

Value

The input dataset with ADY column added

Author(s)

Stefan Bundfuss

Examples

1
2
3
4
5
6
data <- tibble::tribble(
  ~TRTSDT, ~ADT,
  lubridate::ymd("2020-01-01"), lubridate::ymd("2020-02-24")
)

derive_var_ady(data)

epijim/admiral documentation built on Feb. 13, 2022, 12:15 a.m.