plot.insilico: plot CSMF from a "insilico" object

Description Usage Arguments Details Author(s) References See Also Examples

View source: R/plot.r

Description

Produce a bar plot of the CSMFs for a fitted "insilico" object.

Usage

1
2
3
4
5
6
## S3 method for class 'insilico'
plot(x, type = c("errorbar", "bar", "compare")[1],
  top = 10, causelist = NULL, which.sub = NULL, xlab = "Causes",
  ylab = "CSMF", title = "Top CSMF Distribution", horiz = TRUE,
  angle = 60, fill = "lightblue", err_width = 0.4, err_size = 0.6,
  point_size = 2, border = "black", bw = FALSE, ...)

Arguments

x

fitted "insilico" object

type

An indicator of the type of chart to plot. "errorbar" for line plots of only the error bars on single population; "bar" for bar chart with error bars on single population; "compare" for line charts on multiple sub-populations.

top

The number of top causes to plot. If multiple sub-populations are to be plotted, it will plot the union of the top causes in all sub-populations.

causelist

The list of causes to plot. It could be a numeric vector indicating the position of the causes in the InterVA cause list (see causetext), or a vector of character string of the cause names. The argument supports partial matching of the cause names. e.g., "HIV/AIDS related death" could be abbreviated into "HIV"; "Other and unspecified infect dis" could be abbreviated into "Other and unspecified infect".

which.sub

Specification of which sub-population to plot if there are multiple and type is set to "bar".

xlab

Labels for the causes.

ylab

Labels for the CSMF values.

title

Title of the plot.

horiz

Logical indicator indicating if the bars are plotted horizontally.

angle

Angle of rotation for the texts on x axis when horiz is set to FALSE

fill

The color to fill the bars when type is set to "bar".

err_width

Size of the error bars.

err_size

Thickness of the error bar lines.

point_size

Size of the points.

border

The color to color the borders of bars when type is set to "bar".

bw

Logical indicator for setting the theme of the plots to be black and white.

...

Not used.

Details

To-do

Author(s)

Zehang Li, Tyler McCormick, Sam Clark

Maintainer: Zehang Li <[email protected]>

References

Tyler H. McCormick, Zehang R. Li, Clara Calvert, Amelia C. Crampin, Kathleen Kahn and Samuel J. Clark Probabilistic cause-of-death assignment using verbal autopsies, arXiv preprint arXiv:1411.3042 http://arxiv.org/abs/1411.3042 (2014)

See Also

insilico, summary.insilico

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
## Not run: 
data(RandomVA1) 
##
## Scenario 1: without sub-population specification
##
fit1<- insilico(RandomVA1, subpop = NULL,  
              Nsim = 1000, burnin = 500, thin = 10 , seed = 1,
              auto.length = FALSE)
# basic line plot
plot(fit1)
# basic bar plot
plot(fit1, type = "bar")
# line plot with customized look
plot(fit1, top = 15, horiz = FALSE, fill = "gold", 
           bw = TRUE, title = "Top 15 CSMFs", angle = 70, 
           err_width = .2, err_size = .6, point_size = 2)

##
## Scenario 2: with sub-population specification
##
data(RandomVA2)
fit2<- insilico(RandomVA2, subpop = list("sex"),  
              Nsim = 1000, burnin = 500, thin = 10 , seed = 1,
              auto.length = FALSE)
summary(fit2)
# basic side-by-side line plot for all sub-populations
plot(fit2, type = "compare", main = "Top 5 causes comparison")
# basic line plot for specific sub-population
plot(fit2, which.sub = "Women", main = "Top 5 causes for women")
# customized plot with only specified causes
# the cause names need not be exact as InterVA cause list
# substrings in InterVA cause list is enough for specification
# e.g. the following two specifications are the same
some_causes_1 <- c("HIV/AIDS related death", "Pulmonary tuberculosis")
some_causes_2 <- c("HIV", "Pulmonary")
plot(fit2, type = "compare", horiz = FALSE,  causelist = some_causes_1,
              title = "HIV and TB fractions in two sub-populations", 
              angle = 20)

## End(Not run)

InSilicoVA documentation built on July 28, 2018, 5 p.m.