period_adj: Removing last time period

Description Usage Arguments Details Value

View source: R/funcs_2.R

Description

Removes last time period from the data, and changes those patients that had event in this period. Useful in case that the last time period has not finished.

Usage

1
2
period_adj(data, period.length, last.period = NULL,
  varnames = getOption("RCT_names_match"), origin = NULL, numeric = TRUE)

Arguments

data

Data to remove last time period. A data frame with variables inclusion, y, abandon and delta at least. Other variables won't be modified.

period.length

Length of each period.

last.period

Last period to take into account for the adjustment.

varnames

By default getOption("RCT_names_match"). This is a character vector with names "inclusion", "delta" and "y" (in any order), and its corresponding name in the argument data (gives the matching for accessing to inclusion times, censore indicator, and time of follow-up).

origin

Passed to as.period.

numeric

Passed to as.period.

Details

Usually the calendar time partition does not match exactly with the current follow-up time of the RCT. In these cases, the last time period is shorter than the others and one solution is to ignore the data in this time period, removing those patients and correcting censores and events from others.

Value

The same data frame but without the patients included in the last period of time (removed), and some modified delta's.


gcastella/predRCT documentation built on May 16, 2019, 10:15 p.m.