View source: R/find_k_inter_main.R
| sensitivity_analysis_k_inter | R Documentation |
Analyzes how the interaction parameter k_inter affects hazard ratios in different populations (overall, harm subgroup, no-harm subgroup).
sensitivity_analysis_k_inter(
k_inter_range = c(-5, 5),
n_points = 21,
plot = TRUE,
...
)
k_inter_range |
Numeric vector of length 2 specifying the range of k_inter values to analyze. Default is c(-5, 5). |
n_points |
Integer number of points to evaluate within the range. Default is 21. |
plot |
Logical indicating whether to create visualization plots. Default is TRUE. |
... |
Additional arguments passed to |
This function evaluates the hazard ratios at evenly spaced points across the k_inter range. If plot = TRUE, it creates a 4-panel visualization showing:
Harm subgroup HR vs k_inter
All HRs (overall, harm, no-harm) vs k_inter
Ratio of HRs (harm/no-harm) showing effect modification
Table of key values
A data.frame of class "k_inter_sensitivity" with columns:
Numeric k_inter value
Numeric hazard ratio in harm subgroup
Numeric hazard ratio in no-harm subgroup
Numeric overall hazard ratio
Integer size of harm subgroup
## Not run:
# Analyze sensitivity to k_inter
sensitivity_results <- sensitivity_analysis_k_inter(
k_inter_range = c(-2, 2),
n_points = 11,
data = survival::gbsg,
continuous_vars = c("age", "er", "pgr"),
factor_vars = c("meno", "grade"),
outcome_var = "rfstime",
event_var = "status",
treatment_var = "hormon",
subgroup_vars = c("er", "meno"),
subgroup_cuts = list(er = 20, meno = 0),
model = "alt",
plot = TRUE
)
# Results show relationship between k_inter and HRs
print(sensitivity_results)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.