sim.survIC: Simulate interval censored survival data

Description Usage Arguments Details Value Author(s) Examples

View source: R/simSurvIC.R

Description

Function to simulate interval censored survival data

Usage

1
2
3
## S3 method for class 'survIC'
sim(x, n, compliance = 1, latent = TRUE,
  keep.inspectiontimes = FALSE, ...)

Arguments

x

An survIC object as obtained with survIC

n

Number of observations

compliance

Probability of missing an inspection time.

latent

if TRUE keep the latent event times

keep.inspectiontimes

if TRUE keep the inspection times.

...

Extra arguments given to sim

Details

Based on the functionality of the lava PACKAGE

Value

A data set with interval censored observations

Author(s)

Thomas Alexander Gerds

Examples

1
2
3
4
5
library(lava)
example(survIC)
help(survIC)
ol <- survIC()
dat.ol <- sim(ol,10)

Example output

Loading required package: prodlim
lava version 1.5

survIC> ## Not run: 
survIC> ##D library(lava)
survIC> ##D library(prodlim)
survIC> ##D # generate survival model based on exponentially
survIC> ##D # distributed times
survIC> ##D m <- survIC(scale.time=1/50, shape.time=0.7)
survIC> ##D round(sim(m,6),1)
survIC> ##D 
survIC> ##D # Estimate the parameters of the Weibull models
survIC> ##D # based on the uncensored exact event times
survIC> ##D # and the uncensored illstatus.
survIC> ##D set.seed(18)
survIC> ##D d <- sim(m,100,latent=FALSE)
survIC> ##D d$uncensored.status <- 1
survIC> ##D f <- shr(Hist(time=list(L,R),event=uncensored.status)~1,
survIC> ##D          data=d,
survIC> ##D          conf.int=FALSE)
survIC> ##D print(f)
survIC> ## End(Not run)
survIC> 
survIC> 
survIC> 
survIC              package:SmoothHazard               R Documentation

_G_e_n_e_r_a_t_e _s_u_r_v_i_v_a_l _m_o_d_e_l _o_b_j_e_c_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Function to generate a latent variable model for interval censored
     survival times.

_U_s_a_g_e:

     survIC(scale.time = 1/100, shape.time = 1, n.inspections = 5,
       schedule = 10, punctuality = 5)
     
_A_r_g_u_m_e_n_t_s:

scale.time: Weilbull scale for latent time

shape.time: Weilbull shape for latent time

n.inspections: Number of inspection times

schedule: Mean of the waiting time between adjacent inspections.

punctuality: Standard deviation of waiting time between inspections.

_D_e_t_a_i_l_s:

     Based on the functionality of the lava PACKAGE the function
     generates a latent variable model with a latent time and a
     censoring mechanism (censtime,
     inspection1,inspection2,...,inspectionK).

     The function 'sim.survIC' then simulates interval censored times.

_V_a_l_u_e:

     A latent variable model object 'lvm'

_A_u_t_h_o_r(_s):

     Thomas Alexander Gerds

_E_x_a_m_p_l_e_s:

     ## Not run:
     
     library(lava)
     library(prodlim)
     # generate survival model based on exponentially
     # distributed times
     m <- survIC(scale.time=1/50, shape.time=0.7)
     round(sim(m,6),1)
     
     # Estimate the parameters of the Weibull models
     # based on the uncensored exact event times
     # and the uncensored illstatus.
     set.seed(18)
     d <- sim(m,100,latent=FALSE)
     d$uncensored.status <- 1
     f <- shr(Hist(time=list(L,R),event=uncensored.status)~1,
              data=d,
              conf.int=FALSE)
     print(f)
     ## End(Not run)
     

SmoothHazard documentation built on May 2, 2019, 4:43 p.m.