
Render a Forest Plot Table from Disproportionality Data
Source:R/disproportionality_analysis.R
render_forest_table.RdThis function takes a data frame containing disproportionality analysis results
and generates a forest plot table using the forestplot package. It highlights
results with lower confidence intervals greater than zero in red.
Arguments
- disproportionality_df
A
data.tablecontaining the following columns:nested: Type of analysis (e.g., "Crude", "Adjusted")D_E: Observed countexpected: Expected countIC_median: Median Information ComponentIC_lower: Lower bound of the 95% confidence intervalIC_upper: Upper bound of the 95% confidence interval
Details
The function:
Formats the input data for display
Highlights rows with significant IC values (lower CI > 0) in red
Adds horizontal lines and zebra striping for readability
Sets custom x-axis ticks and labels
Examples
if (FALSE) { # \dontrun{
library(data.table)
df <- data.table(
nested = c("Crude", "Adjusted"),
D_E = c(10, 8),
expected = c(5.5, 6.2),
IC_median = c(1.2, 0.8),
IC_lower = c(0.5, -0.2),
IC_upper = c(1.9, 1.3)
)
render_forest_table(df)
} # }