Learn R Programming

netcox (version 1.0.1)

sim: A simulated demo dataset sim

Description

A simulated demo dataset sim

Usage

data(sim)

Arguments

Format

A simulated data frame that is used to illustrate the use of the netcox package. The max follow-up time for each subject is set to be 5. The total number of subject is 50.

Id

The ID of each subject.

Event

During the time from Start to Stop, if the subject experience the event. We use the function permalgorithm in the R package PermAlgo to generate the Event.

Start

Start time.

Stop

Stop time.

Fup

The total follow-up time for the subject.

Covariates

A1, A2, C1, C2, B, A1B, A2B, C1B, C2B. The dataset contains 5 variables (9 columns after one-hot encoding). Variable A is a e 3-level categorical variable, which results in 2 binary variables (A1 and A2), the same with the variable C. B is a continuous variable. The interaction term AB and CB are also two 3-level categorical variables. The code for generating the covariates is given below.

See Also

PermAlgo

Examples

Run this code
# generate B
gen_con=function(m){
 X=rnorm(m/5)
 XX=NULL
 for (i in 1:length(X)) {
   if (length(XX)

Run the code above in your browser using DataLab