Skip to contents

Summarizes cross-validation results for ForestSearch, including subgroup agreement and performance metrics.

Usage

forestsearch_KfoldOut(res, details = FALSE, outall = FALSE, digits = 4)

Arguments

res

List. Result object from ForestSearch cross-validation, must contain elements: cv_args, sg_analysis, sg0.name, sg1.name, Kfolds, resCV.

details

Logical. Print details during execution (default: FALSE).

outall

Logical. If TRUE, returns all summary tables; if FALSE, returns only metrics (default: FALSE).

digits

Integer. Decimal places for construction-time numeric formatting in the per-fold summary tables built when outall = TRUE (arm summaries, Diff, effect-estimate CI). Default 4 to provide round-down headroom for downstream display reformatting (e.g., cv_summary_tables(digits = ...)). Threaded through SG_tab_estimates_glm for GLM outcomes. Ignored when outall = FALSE.

Value

If outall=FALSE, a list with sens_metrics_original and find_metrics. If outall=TRUE, a list with summary tables and metrics. For GLM outcomes the tables (itt_tab, SG_tab_original, SG_tab_Kfold, tab_all) are built by SG_tab_estimates_glm. Their effect column follows the fit's orientation (the fit's stored adverse_outcome or, when none is stored, forestsearch's rule: TRUE for binary and count outcomes, FALSE otherwise), while, for a fit with the default est.scale = "hr", the arm columns (Rate(C) or Mean(C), Rate(T) or Mean(T)) and their raw difference Diff (treated minus control) do not. So for an unadjusted fit where a lower outcome is adverse (adverse_outcome = FALSE, the default for continuous outcomes) the effect and Diff have opposite signs. Count outcomes and the rate measures (IRR, IRD) are not reoriented. See sg_tables for the details.

Examples

if (FALSE) { # \dontrun{
library(survival)
df <- survival::gbsg
df$grade3 <- as.integer(df$grade == "3")
fs <- forestsearch(df,
  confounders.name = c("age", "meno", "size", "grade3", "nodes", "pgr", "er"),
  outcome.name = "rfstime", treat.name = "hormon", event.name = "status")
oob <- forestsearch_Kfold(fs.est = fs, Kfolds = nrow(df))
result <- forestsearch_KfoldOut(oob, outall = TRUE)
} # }