Prepare Forest plot data for odds ratio

prepare_odds_ratio_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_odds_ratio_data(
  forest_plot_src,
  "Y",
  "Calculated"
)
#> [2024-07-18 02:40:03] >
#> CI for odds ratio for binary outcomes is calculated and saved
#> [2024-07-18 02:40:03] > Prepare Forest plot data for odds ratio
head(forest_plot_data)
#>   treatment  factor   type          outcome       diff        se      lower
#> 1    Drug A Benefit Binary Primary Efficacy 0.06178490 0.1583616 0.04529859
#> 2    Drug A    Risk Binary   Reoccurring AE 0.13185024 0.2021435 0.08871889
#> 3    Drug A    Risk Binary         Rare SAE 0.13159653 0.7541113 0.03001537
#> 4    Drug A    Risk Binary            Liver 0.24924925 1.1189303 0.02780985
#> 5    Drug B Benefit Binary Primary Efficacy 0.25531915 0.1548564 0.18848179
#> 6    Drug B    Risk Binary   Reoccurring AE 0.04601571 0.3283065 0.02417971
#>        upper group
#> 1 0.08427135     1
#> 2 0.19595023     2
#> 3 0.57695927     3
#> 4 2.23392741     4
#> 5 0.34585764     5
#> 6 0.08757117     6