Prepare Forest plot data for absolute risk

prepare_absolute_risk_data(
  data,
  change_ref = c("Y", "N"),
  ci_method = c("Supplied", "Calculated")
)

Arguments

data

(data.frame) Effects table

change_ref

Change reference group ("Y" or "N)

ci_method

(character) confidence interval method, either Supplied (taken from the effect table) or Calculated (calculated within the program).

Value

data frame for specified type of analysis

Examples

forest_plot_src <- subset(effects_table, !is.na(Prop1))
forest_plot_data <- prepare_absolute_risk_data(
  forest_plot_src,
  "Y",
  "Calculated"
)
#> [2024-08-28 08:20:51] >
#> absolute risk CI for binary outcomes is calculated and saved
#> [2024-08-28 08:20:51] > Prepare Forest plot data for absolute risk
head(forest_plot_data)
#>   treatment  factor   type          outcome   diff          se        lower
#> 1    Drug A Benefit Binary Primary Efficacy -0.410 0.017201744 -0.443714799
#> 2    Drug A    Risk Binary   Reoccurring AE -0.160 0.013527749 -0.186513901
#> 3    Drug A    Risk Binary         Rare SAE -0.013 0.004095241 -0.021026525
#> 4    Drug A    Risk Binary            Liver -0.003 0.002232263 -0.007375156
#> 5    Drug B Benefit Binary Primary Efficacy -0.140 0.014710540 -0.168832129
#> 6    Drug B    Risk Binary   Reoccurring AE -0.170 0.012549900 -0.194597353
#>          upper group
#> 1 -0.376285201     1
#> 2 -0.133486099     2
#> 3 -0.004973475     3
#> 4  0.001375156     4
#> 5 -0.111167871     5
#> 6 -0.145402647     6