require(DTR)
#-------Example function usage-----------
n <- 500
max.c <- 3.5*365
pi.r <- 0.5
pi.z <- 0.5
mean.T0 <- 182.5
mean.TR <- 365
mean.T1 <- 365
mean.T2 <- 547.5
# Generate data as in Guo and Tsiatis (2005)
set.seed(123) # Set a seed to reproduce the same data every time running the following command
data <- sim.WRSE.data(n,max.c,pi.r,pi.z,mean.T0,mean.TR,mean.T1,mean.T2)
# Calculate WRSE
WRSE.estimator(data,t=c(150,500,700))
Run the code above in your browser using DataLab