Prepare Forest plot data for exposure-adjusted rates

prepare_absolute_risk_exp_adj(
  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(Rate_Type))

forest_plot_data <- prepare_absolute_risk_exp_adj(
  forest_plot_src,
  "Y",
  "Calculated"
)
#> [2024-08-25 14:26:19] >
#> CI for treatment difference in exposure-adjusted rates
#> is calculated and saved in a dataframe
#> [2024-08-25 14:26:19] > Prepare Forest plot data for exposure-adjusted rates
head(forest_plot_data)
#>   treatment   type factor                  outcome   diff          se
#> 1    Drug A Binary   Risk Reoccurring AE EventRate -0.720 0.027928480
#> 2    Drug A Binary   Risk         Rare SAE IncRate -0.299 0.017349352
#> 3    Drug A Binary   Risk            Liver IncRate -0.014 0.004000000
#> 4    Drug B Binary   Risk Reoccurring AE EventRate -0.320 0.019493589
#> 5    Drug B Binary   Risk         Rare SAE IncRate -0.299 0.017349352
#> 6    Drug B Binary   Risk            Liver IncRate -0.010 0.003162278
#>         lower        upper group
#> 1 -0.77473882 -0.665261185     1
#> 2 -0.33300410 -0.264995896     2
#> 3 -0.02183986 -0.006160144     3
#> 4 -0.35820673 -0.281793268     4
#> 5 -0.33300410 -0.264995896     5
#> 6 -0.01619795 -0.003802050     6