Displaying 1 result from an estimated 1 matches for "bhaz".
Did you mean:
baz
2009 Jun 07
1
Survreg function for loglogistic hazard estimation
...istic estimation
library(survival)
# Clear the workspace
rm(list = ls(all = TRUE))
# Totally 100K samples which may die during 100 periods
timeline = 100
samplesize = 100000
dfico <- rnorm(samplesize, mean = 0, sd = 25)
dficoeff <- 0.005
# Baseline loglogistic hazard function stored in bhaz
a<- 20
b <- 4
time <- 1:timeline
bhaz <- ((b/a) * (time /a) ^ (b-1))/(1+(time/a)^b)
# Event time stored in endtime. Baseline hazard function is controlled by
# dfico value with factor loading dficoeff
endtime <- numeric(samplesize)
for ( i in 1:samplesize) {
rnos <- runif(time...