2
$\begingroup$

I would like to simulate interval-censored data in a Cox model. In the R package intcox I found the following code:

sim.weibull.intcox.rfc <-function(N=200, beta.0=0.1, beta.cov=c(0.5,-0.5,0.5,0.5),
                                  alpha=0.75, p.cov=c(0.5,0.75), grid=10)
{
  x.design <- cbind(rbinom(N,1,p.cov[1]), rbinom(N,1,p.cov[2]), runif(N,-1,1), 
                    rnorm(N,0,1))
  colnames(x.design) <- paste("x.",1:4,sep="")
  lambda  <- exp(beta.0+x.design%*%matrix(beta.cov,ncol=1))
  scale   <- (1/lambda)^(1/alpha)
  t.true  <- rweibull(N,alpha,scale)
  T.max   <- max(qweibull(0.9,alpha,median(scale)))
  t.left  <- NULL
  t.right <- NULL
  for (i in 1:N) {
    tt <- unique(c(0,sort(runif(grid,0,T.max)),T.max))
    if(t.true[i]>=T.max) {
      x.left  <- T.max
      x.right <- NA
    } else {
      x.left  <- max(tt[t.true[i]>tt])
      x.right <- min(tt[t.true[i]<tt])
    }
    t.left  <- c(t.left,x.left)
    t.right <- c(t.right,x.right)
  }
return(data.frame(ID=1:N, left=t.left, right=t.right, x.design))
}

They applied Weibull distributed random variables with shape=0.75, while scale is derived from $(1/λ)^{(1/{\rm shape})}$ with $λ = \exp(β_0 + β'X)$ where $β = 0.5, −0.5, 0.5, 0.5$ and design matrix $X$ which is formed by the four covariates.

My question is:

  1. Why did they use $λ = \exp(β_0 + β'X)$ for calculating the scale parameter beta? Also, is their baseline hazard function decreasing given that shape = 0.75?
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.