title: Mean beta hat does not equal to true beta by sim.survdata
body: <p>I recently use the R &quot;sim.survdata&quot; function in &quot;coxed&quot; package to simulate survival data. I did 2k simulations with one covariate and coefficient = 1. Each time I fitted a Cox regression and recorded the estimated beta and 95% CI. However the mean(betahat) doesn't equal to 1, and CIs do not cover 1 at 95% times. Please see the codes I used below. I wonder the reasons, any input is welcomed. Thank you in advance.</p>
  <pre><code>bhat=NULL
  lb=NULL
  ub=NULL
  for(i in 1:2000){
  set.seed(20110312+i)
  simdata &lt;- sim.survdata(N=2633, T=200, xvars=1, censor=.85, num.data.frames = 1, beta = 1)
  simdata$data$event=as.numeric(simdata$data$failed)
  fit=coxph(Surv(y,event==1)~X,data=simdata$data)
  bhat=c(bhat,summary(fit)$coefficients[1])
  lb=c(lb,log(summary(fit)$conf.int[3]))
  ub=c(ub,log(summary(fit)$conf.int[4]))
  }
  
  &gt; mean(bhat)
  [1] 0.9408025
  &gt; mean(lb&lt;=1 &amp; ub&gt;=1)
  [1] 0.904
  </code></pre>