Error when using robust regression in survreg. I think the issue is that robust regression gives a summary table with an extra column (called "(Naive SE)").
fmla <- as.formula(paste("Surv(time, status) ~ ","karno + age" ))
fit <- survreg(formula = fmla, data = veteran, dist = "lognormal", robust = T)
broom::tidy(fit)
summary(fit)$table
I propose changing the tidy.survreg function as follows to fix this error
tidy.survreg <- function(x, conf.level = .95, conf.int = FALSE, ...) {
s <- summary(x)
# add extra column name here
nn <- c("estimate", "std.error", "(Naive SE)", "statistic", "p.value")
ret <- fix_data_frame(s$table, newnames = nn)
if(conf.int){
# add confidence interval
ci <- stats::confint(x, level = conf.level)
colnames(ci) <- c("conf.low", "conf.high")
ci <- fix_data_frame(ci)
ret <- as_tibble(merge(ret, ci, all.x = TRUE, sort = FALSE))
}
ret
}
Error when using robust regression in survreg. I think the issue is that robust regression gives a summary table with an extra column (called "(Naive SE)").
I propose changing the tidy.survreg function as follows to fix this error