transdata: Transfer Input Data Frame to Model Fitting Data Frame

Description Usage Arguments Details Value Note Author(s) Examples

View source: R/transdata.R

Description

This function transfers the original input data frame to required data frame for model fitting.

Usage

1
transdata(data, ndlevel, nexposure)

Arguments

data

a data frame which must include variables named "time" and "delta".

ndlevel

a value: number of dose levels.

nexposure

a vector: number of challenges or exposures for each dose level.

Details

The original data frame from users include the time points when the subjects are right-censored or failed, the censoring status, vaccination status and baseline information. In addition, users must provide dose information including dose level and number of challenges or exposures for each dose level. However, the original data frame cannot be used directly to create design matrix because dose levels are time-dependent. Therefore, this function lists all time points before or at the right-censoring time or failure time for each subject. Then for each subject the function replicates each dose level multiple times according to the number of challenges the subject receives at each dose level. Finally, the function replicates the vaccination status and baseline information and returns a whole data frame.

Value

a data frame containing variables "id", "time", "delta", "dose", vaccination status and baseline information.

Note

The original data frame must have "time" and "delta" variables.

Author(s)

Bin Yao, Ying Huang and Chaeryon Kang

Examples

1
2
data(SampleData)
newdata <- transdata(data = SampleData, ndlevel = 3, nexposure = c(10, 10, 2))

rld documentation built on May 2, 2019, 5:57 a.m.