conf_int_row lookup is fragile
conf_int_row <- paste0(arm, current_arm)
This constructs "armB" to index into coxph_ans$conf.int. But arm is the column name string (e.g., "arm"), not the variable name in the model. If the user's column is named "TRT01A", the row name would be "TRT01AXanomeline High Dose". This works, but only because coxph names coefficients as . If the formula has covariates (e.g., Surv(time, status) ~ arm + age), the conf.int matrix has multiple rows and the indexing still works because it's by row name. This is fine but worth a comment.
conf_int_row lookup is fragile
conf_int_row <- paste0(arm, current_arm)This constructs "armB" to index into
coxph_ans$conf.int. But arm is the column name string (e.g., "arm"), not the variable name in the model. If the user's column is named"TRT01A", the row name would be"TRT01AXanomeline High Dose". This works, but only because coxph names coefficients as . If the formula has covariates (e.g.,Surv(time, status) ~ arm + age), theconf.intmatrix has multiple rows and the indexing still works because it's by row name. This is fine but worth a comment.