Learn R Programming

openVA (version 1.0.5)

stackplotVA: plot grouped CSMF from a "insilico" object

Description

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

Usage

stackplotVA(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

one or a list of fitted object from codeVA function

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.

Examples

Run this code
# NOT RUN {
data(RandomVA3)
test <- RandomVA3[1:200, ]
train <- RandomVA3[201:400, ]
fit1 <- codeVA(data = test, data.type = "customize", model = "InSilicoVA",
                    data.train = train, causes.train = "cause",
                    Nsim=1000, auto.length = FALSE)

fit2 <- codeVA(data = test, data.type = "customize", model = "InterVA",
               data.train = train, causes.train = "cause",
               version = "4.02", HIV = "h", Malaria = "l")

fit3 <- codeVA(data = test, data.type = "customize", model = "Tariff",
               data.train = train, causes.train = "cause", 
               nboot.sig = 100)
fit4 <- codeVA(data = test, data.type = "customize", model = "NBC",
               data.train = train, causes.train = "cause", known.nbc = TRUE)

data(SampleCategory3)
stackplotVA(fit1, grouping = SampleCategory3, type ="dodge", 
            ylim = c(0, 1), title = "InSilicoVA")
stackplotVA(fit2, grouping = SampleCategory3, type = "dodge", 
            ylim = c(0, 1), title = "InterVA4.02")
stackplotVA(fit3, grouping = SampleCategory3, type = "dodge", 
            ylim = c(0, 1), title = "Tariff")
stackplotVA(fit4, grouping = SampleCategory3, type = "dodge", 
            ylim = c(0, 1), title = "NBC")
# }

Run the code above in your browser using DataLab