Learn R Programming

DALY (version 1.5.0)

scatterplot: Scatterplot method for class 'DALY' and 'DALY_list'

Description

Generate a scatterplot of population versus patient level burden. The method is available for objects of class 'DALY' and 'DALY_list'.

Usage

"scatterplot"(x, plot = c("DALY", "YLD", "YLL"), outcomes = TRUE, per = 1000, samples = 1000, pch = 16, col = NULL, legend = NULL, legend_pos = c("topright", "topleft", "bottomright", "bottomleft"), ...)
"scatterplot"(x, plot = c("DALY", "YLD", "YLL"), per = 1000, samples = 1000, pch = 16, col = NULL, legend = NULL, legend_pos = c("topright", "topleft", "bottomright", "bottomleft"), ...)

Arguments

x
Object of class 'DALY' or 'DALY_list'
plot
Which estimates should be plotted? Must be either "DALY", "YLD" or "YLL"
outcomes
Should different outcomes be plotted? Defaults to TRUE. If FALSE, aggregated estimates are plotted
per
Denominator for population level burden. Defaults to 1000
samples
Number of samples to plotted. Defaults to 1000
pch
Plotting symbol. Defaults to 16 (= solid circle). See pch for more info
col
Plotting color. Defaults to NULL, in which case the function tries to generate distinctive rainbow colors
legend
A character or expression vector of length $\ge 1$ to appear in the legend. Defaults to NULL, in which case the legend names are derived from the plotted objects; if FALSE, no legend is plotted
legend_pos
The position of the legend, either "topright", "topleft", "bottomright" or "bottomleft"
...
Additional arguments to be passed to plot

Details

This function generates a scatterplot of the estimated burden at the population level (x-axis) versus the patient level (y-axis). Scatterplots can be generated of 'DALY' objects, to visualize the overall or outcome-specific burden; and of 'DALY_list' objects, to compare the overall burden of, e.g., different diseases or different DALY calculation scenarios.

See Also

DALY_list

plot.DALY, hist.DALY

DALYcalculator (for a brief description of the DALY Calculator) DALYmanual (for a more comprehensive overview)

Examples

Run this code
## Not run: 
# 
# ##= load toxoplasmosis example ============================
# setDALYexample(2)
# 
# ##= perform DALY calculation for different scenarios ======
# toxo_00 <- getDALY(aw = FALSE, dr = 0)
# toxo_03 <- getDALY(aw = FALSE, dr = 0.03)
# toxo_13 <- getDALY(aw = TRUE,  dr = 0.03)
# 
# ##= combine scenarios in 'DALY_list' ======================
# toxo <- DALY_list(toxo_00, toxo_03, toxo_13)
# 
# ##= plot YLL and YLL for toxo_00 ==========================
# par(mar = c(4, 4, 1, 1) + .5)
# par(mfrow = c(1, 2))
# scatterplot(toxo_00, plot = "YLL",
#             outcomes = FALSE, legend = FALSE)
# scatterplot(toxo_00, plot = "YLD",
#             outcomes = FALSE, legend = FALSE)
# 
# ##= plot all three scenarios ==============================
# par(mfrow = c(1, 1))
# scatterplot(toxo,
#             legend = c("DALY[0,0]",
#                        "DALY[0,0.03]",
#                        "DALY[1,0.03]"),
#             legend_pos = "topleft",
#             log = "xy",
#             main = "Scenario analysis")
# ## End(Not run)

Run the code above in your browser using DataLab