Learn R Programming

JMbayes2 (version 0.4-5)

rc_setup: Combine Recurring and Terminal Event Data in Long Format

Description

This function combines two data frames, the recurring event and terminal event datasets, into one. Each subject has as many rows in the new data frame as the number of recurrent risk periods plus one for the terminal event.

Usage

rc_setup(rc_data, trm_data,
    rc_idVar = "id", rc_statusVar = "status",
    rc_startVar = "start", rc_stopVar = "stop",
    trm_idVar = "id", trm_statusVar = "status",
    trm_stopVar = "stop",
    nameStrata = "strata", nameStatus = "status")

Value

A data frame in the long format with multiple rows per subject.

Arguments

rc_data

the data frame containing the recurring event data with multiple rows per subject.

trm_data

the data frame containing the terminal event data with a single row per subject.

rc_idVar

a character string denoting the name of the variable in rc_data that identifies the subject.

rc_statusVar

a character string denoting the name of the variable in rc_data that identifies the status variable which equals 1 if the subject had an event and 0 otherwise.

rc_startVar

a character string denoting the name of the variable in rc_data that identifies the starting time for the interval.

rc_stopVar

a character string denoting the name of the variable in rc_data that identifies the stopping time for the interval.

trm_idVar

a character string denoting the name of the variable in trm_data that identifies the subject.

trm_statusVar

a character string denoting the name of the variable in trm_data that identifies the status variable which equals 1 if the subject had the event and 0 otherwise.

trm_stopVar

a character string denoting the name of the variable in trm_data that identifies the follow up time.

nameStrata

a character string denoting the variable that will be added in the long version of data denoting the various causes of event.

nameStatus

a character string denoting the variable that will be added in the long version of data denoting if the subject had an event.

Author

Pedro Miranda Afonso p.mirandaafonso@erasmusmc.nl