generate_data: Generate Data

Description Usage Arguments Value Examples

View source: R/generate_data.R

Description

The function generate_data generates example survival data

Usage

1
2
3
4
generate_data(true_beta = c(c(0.5, -0.5, 1, -1, 1.5), rep(0, 5)),
  F_pre = 1:10, gamma = rep(1, 10), mean_sample_size = 50,
  Sigma_z1 = diag(length(true_beta)), censoring_up_bound = 30,
  censoring_trunc = 3, order = T)

Arguments

true_beta

true parameters

F_pre

a unique list of facilities

gamma

true facility effects of each facility, notice length of gamma must be the same as length of F_pre

mean_sample_size

expected sample size of each facility (stratum), a scalar same in all facilities

Sigma_z1

Var-Cov matrix of design matrix

censoring_up_bound

maximum value that the censoring time can take

censoring_trunc

maximum observation time

order

whether the output data should be ordered by time

Value

a list of generated data:

delta

event indicator

z

design matrix

facility

which facility each patient belongs to

num_facility

number of facilities (strata)

time

obseved time for each patient

true_beta

true parameters

N

number of patients

Examples

1
surv_dat = generate_data()

XuemeiDing/survival19 documentation built on Dec. 1, 2019, 9:52 p.m.