Displaying 1 result from an estimated 1 matches for "fico_demean".
2009 Jun 07
1
Survreg function for loglogistic hazard estimation
...unction is controlled by
# dfico value with factor loading dficoeff
endtime <- numeric(samplesize)
for ( i in 1:samplesize) {
rnos <- runif(timeline)
endtime[i] <- which(rnos <= bhaz * exp(dfico[i]*dficoeff))[1]
}
# Construct data frame
raw <- data.frame(end = endtime, status = 1, fico_demean = dfico)
# Adding censorship
for( i in 1:samplesize) {
if(is.na(raw$end[i])) {raw$status[i] <- 0}
}
for( i in 1:samplesize) {
if(is.na(raw$end[i])) {raw$end[i] <- timeline }
}
# Output the factory
factory <- factor(raw$end)
plot(factory)
# Use survreg to estimate the coefficents of log...