prepare_dot_forest_plot_data.Rd
Prepare data for Dot and Forest plots
pre_proc(data, typeval, cod)
prepare_dot_forest_plot_data(
data,
drug,
benefit,
risk,
filters,
category,
type_graph,
type_risk,
ci_method = c("Supplied", "Calculated"),
space_btwn_out_yn = "Y"
)
(data.frame
) dataset.
(character
) Benefit or Risk
(character
) identifier either c - continuous or b for binary
(character
) selected drug.
(character
) selected benefit.
(character
) selected risk.
(character
) selected filter.
(character
) selected category.
(character
) selected way to display binary outcomes
(absolute risk, relative risk, odds ratio).
(character
) selected way to display risk outcomes
(crude proportions, exposure-adjusted rates per 100 PYs
(character
) confidence interval method,
either Supplied
(taken from the effect table)
or Calculated
(calculated within the program).
(character
) control spacing between outcomes
pre_proc()
: adds a variable in dataframe which
identifies whether the dataframe is for Benefit or Risk analysis.
dot_plot_src <- subset(effects_table, !is.na(Prop1))
bdin <- subset(dot_plot_src, Factor == "Benefit")
rdin <- subset(dot_plot_src, Factor == "Risk")
fplot_data <- prepare_dot_forest_plot_data(
data = dot_plot_src,
drug = unique(dot_plot_src$Trt1),
benefit = unique(bdin$Outcome),
risk = unique(rdin$Outcome),
filters = "None",
category = "All",
type_graph = "Absolute risk",
type_risk = "Crude proportions",
ci_method = "Calculated",
space_btwn_out_yn = "N"
)
#> [2024-08-28 08:20:52] > Prepare Dot plot data for binary outcomes
#> [2024-08-28 08:20:52] > trigger analysis based on type
#> [2024-08-28 08:20:52] >
#> absolute risk CI for binary outcomes is calculated and saved
#> [2024-08-28 08:20:52] > Prepare Forest plot data for absolute risk
#> [2024-08-28 08:20:52] > Prepare Dot plot data for binary outcomes
#> [2024-08-28 08:20:52] > trigger analysis based on type
#> [2024-08-28 08:20:52] >
#> absolute risk CI for binary outcomes is calculated and saved
#> [2024-08-28 08:20:52] > Prepare Forest plot data for absolute risk
#> [2024-08-28 08:20:52] > Dataout object from the create_order_label_der function is created
#> [2024-08-28 08:20:52] > Prepare data for Dot and Forest plots