Description Usage Arguments Details Value Examples
Simulate data as in Fong and Gilbert (2014).
1 2 3 4 |
n |
integer. Sample size |
family |
string. Link functions in the semiparametric transformation model |
beta |
numerical vector. Coefficients of the linear model |
random.censoring |
string. Random censoring in addition to administrative censoring |
prevalence |
numerical. Proportion of cases among z==0 when there is no random censoring and non-adherence ratio is 0 |
design |
string. Full cohort or case-cohort (finite population sampling) |
auxiliary |
string. |
seed |
integer. Random generator seed |
var.S |
numeric. Variance of the phase II covariate s |
var.W |
numeric. Variance of the baseline covariate w |
non.adherence.ratio |
ratio of non-adherent |
The number of rows is the size of the full cohort. Adherence ratio works as a Bernoulli variable. Prevalence is used to compute baseline hazard function based on some empirical evidence.
If design is FULL, returns a data frame of:
ft |
failure time |
C |
censoring time |
X |
smaller of the ft and C |
d |
event indicator |
z |
baseline covariate z |
s |
phase II covariate s |
If design is CC, returns a data frame of:
ft |
failure time |
C |
censoring time |
X |
smaller of the ft and C |
d |
event indicator |
z |
baseline covariate z |
s |
phase II covariate s |
w |
baseline auxiliary covariate w |
1 2 3 4 5 6 7 8 9 10 11 12 13 | dat = sim.fong(n=10000, family="PH", beta=c(log(.5), log(.7), log(1.2)), design="CC",
auxiliary="weak", seed=1, prevalence=0.1, non.adherence.ratio=0, random.censoring="0")
mean(dat$d[dat$z==0])
dat = sim.fong(n=10000, family="PH", beta=c(log(.5), log(.7), log(1.2)), design="CC",
auxiliary="weak", seed=1, prevalence=0.1, non.adherence.ratio=0.15, random.censoring="0")
sum(dat$d & !is.na(dat$s))
sum(!dat$d & !is.na(dat$s)) / sum(dat$d & !is.na(dat$s))
dat = sim.fong(n=10000, family="PH", beta=c(log(.5), log(.7), log(1.2)), design="CC",
auxiliary="weak", seed=1, prevalence=0.1, non.adherence.ratio=0.15, random.censoring="20")
sum(dat$d & !is.na(dat$s))
sum(!dat$d & !is.na(dat$s)) / sum(dat$d & !is.na(dat$s))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.