stackplot: plot grouped CSMF from a "insilico" object

Description Usage Arguments Author(s) References See Also Examples

View source: R/groupplot.r

Description

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

Usage

1
2
3
4
5
6
stackplot(x, grouping = NULL, type = c("stack", "dodge")[1],
  order.group = NULL, order.sub = NULL, err = TRUE, CI = 0.95,
  sample.size.print = FALSE, xlab = "Group", ylab = "CSMF", ylim = NULL,
  title = "CSMF by broader cause categories", horiz = FALSE, angle = 60,
  err_width = 0.4, err_size = 0.6, point_size = 2, border = "black",
  bw = FALSE, ...)

Arguments

x

fitted "insilico" object

grouping

C by 2 matrix of grouping rule. If set to NULL, make it default.

type

type of the plot to make

order.group

list of grouped categories. If set to NULL, make it default.

order.sub

Specification of the order of sub-populations to plot

err

indicator of inclusion of error bars

CI

confidence interval for error bars.

sample.size.print

Logical indicator for printing also the sample size for each sub-population labels.

xlab

Labels for the causes.

ylab

Labels for the CSMF values.

ylim

Range of y-axis.

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

err_width

Size of the error bars.

err_size

Thickness of the error bar lines.

point_size

Size of the points.

border

The color for the border of the bars.

bw

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

...

Not used.

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
  data(RandomVA1) 
  ##
  ## Scenario 1: without sub-population specification
  ##
  fit1<- insilico(RandomVA1, subpop = NULL,  
                Nsim = 1000, burnin = 500, thin = 10 , seed = 1,
                auto.length = FALSE)
  # stack bar plot for grouped causes
  # the default grouping could be seen from
  data(SampleCategory)
  stackplot(fit1, type = "dodge", xlab = "")
  
  ##
  ## 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)
  stackplot(fit2, type = "stack", angle = 0)
  stackplot(fit2, type = "dodge", angle = 0)
  # Change the default grouping by separating TB from HIV
  data(SampleCategory)
  SampleCategory[c(3, 9), ]
  SampleCategory[3, 2] <- "HIV/AIDS"
  SampleCategory[9, 2] <- "TB"
  stackplot(fit2, type = "stack", grouping = SampleCategory, 
            sample.size.print = TRUE, angle = 0)
  stackplot(fit2, type = "dodge", grouping = SampleCategory,
            sample.size.print = TRUE, angle = 0)
  
  # change the order of display for sub-population and cause groups
  groups <- c("HIV/AIDS", "TB", "Communicable", "NCD", "External",
              "Maternal", "causes specific to infancy") 
  subpops <- c("Women", "Men")
  stackplot(fit2, type = "stack", grouping = SampleCategory, 
            order.group = groups, order.sub = subpops, 
            sample.size.print = TRUE, angle = 0)	
 

InSilicoVA documentation built on Sept. 21, 2018, 6:27 p.m.