dot_plot | R Documentation |
creates a dot-plot of safety data showing the absolute and relative risks
dot_plot(
safety,
type = c("non_serious", "serious"),
reference = safety$GROUP$title[1],
size = 95,
text_width = 10,
base = 2,
valid_estimates = TRUE
)
safety |
an object created by |
type |
a choice of "non_serious" (default) or "serious" as to which type of AE to report on |
reference |
character vector naming the reference arm for the calculations. Defaults to the first row of the safety$GROUP. |
size |
a number between 0-100, giving the size of the confidence interval. Default is 95. |
text_width |
Integer giving a target width to which the labels are wrapped. Defaults to 10. |
base |
numeric value to which a log scale uses as tick marks. Suggest powers of 2, or 5. |
valid_estimates |
a logical, which determines if only terms with valid estimates of relative risk are included in the table. The alternative is to include terms with zeroes. |
This is essentially a list of two ggplot objects joined together in a list, named as "left.panel" and "right.panel". They can each be individually edited if needed
a graphical object that shows the estimates and CI of relative and absolute risk.
safety_summary
relative_risk
[relative_risks()]
safety_statistics <- safety_summary(safety,
exposed=c("Experimental"=60,"Control"=67))
head( relative_risk(safety_statistics, type="serious") )
fig <- dot_plot(safety_statistics, type="non_serious", base=4)
fig
fig$left.panel <- fig$left.panel + ggplot2::labs(title="Absolute Risk")
fig
temp <- tempfile(fileext=".png")
png(filename = temp)
print(fig)
dev.off()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.