insightsengineering / insightsengineering/crane

Fragile lookup of conf_int_row in `get_cox_pairwise_df()`

Open
#247 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
R
Stars
15
Forks
7
Avg merge
6d 9h
Merged PRs (30d)
5

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.