Displaying 1 result from an estimated 1 matches for "wscale1".
Did you mean:
wscale
2012 Sep 03
2
Coxph not converging with continuous variable
..., sessionInfo follows signature.
Alex Keil
UNC Chapel Hill
Here's an example:
library(survival)
set.seed(8182828)
#data
N = 100000
shape = 0.75
hr = 3.5
betax <- -log(hr)/(shape)
ctime = 5
z1 <- rbinom(N, 1, 0.5)
z2 <- rbinom(N, 1, 0.5)
x1 <- exp(rnorm(N, 0 + 2*z1, 1))
wscale1 <- exp(0 + betax*x1 + z1 + z2 )
time1 <- rweibull(N, shape, wscale1)
t1 <- pmin(time1, rep(ctime, N))
d1 <- 1*(t1 == time1)
dat <- as.data.frame(cbind(t1, time1, d1, z1, z2, x1))
summary(dat)
#output
> summary(dat)
t1 time1 d1...