a note if it there is room for improvement, see test-plotOc the first helper function, particularly:
result <- h_get_dataframe_oc(
decision = res2$Decision,
all_sizes = res2$SampleSize,
all_looks = res2$Looks
)
gives the following result for res2$oc :
> res2$oc
ExpectedN PrStopEarly PrEarlyEff PrEarlyFut PrEfficacy PrFutility PrGrayZone
1 17.57 0.68 0.62 0.06 0.71 0.06 0.23
of note, these results are not the final data for the image below for plotOc(res2.... ). The PrEff, PrFutility and PrGrayZone adds up to 1, whereas in debugging mode, plotOc utilises this output:
df <- data.frame(
decision = decision,
all_sizes = all_sizes,
all_looks = all_looks # original looks
)
# summarise into frequency table
df <- df |>
dplyr::group_by(decision, all_looks) |>
dplyr::summarise(prop = sum(length(decision)) / nrow(df)) |>
tibble::as_tibble()
giving:
# A tibble: 6 × 3
decision all_looks prop
<fct> <dbl> <dbl>
1 TRUE 10 0.51
2 TRUE 20 0.11
3 TRUE 30 0.09
4 FALSE 10 0.05
5 FALSE 20 0.01
6 NA 30 0.23
if the plot takes away anything important - then this can be looked at.
a note if it there is room for improvement, see test-plotOc the first helper function, particularly:
gives the following result for res2$oc :
of note, these results are not the final data for the image below for
plotOc(res2.... ). The PrEff, PrFutility and PrGrayZone adds up to 1, whereas in debugging mode, plotOc utilises this output:giving:
if the plot takes away anything important - then this can be looked at.