Learn R Programming

ham (version 1.1.0)

plot.group: Confidence interval graphs for group class objects

Description

Confidence interval graphs for group class objects

Usage

# S3 method for group
plot(
  x,
  y = "group",
  order = "alpha",
  gcol = "blue",
  gband = FALSE,
  pcol = "red",
  overall = FALSE,
  ocol = "gray",
  oband = FALSE,
  tgt = NULL,
  tcol = "gray",
  tpline = NULL,
  tpcol = "gray",
  xlim = NULL,
  ylim = NULL,
  main = NULL,
  lwd = 1,
  adj.alpha = 0.4,
  cex = 1,
  cex.axis = 1,
  cex.lab = 1,
  cex.main = 1,
  cex.text = 1,
  round.c = 2,
  name = FALSE,
  abbrv = 5,
  ...
)

Value

plot of group level confidence intervals, including estimates over time periods.

Arguments

x

group object.

y

type of confidence interval object, specify either 'group', 'time', or 'roll'.

order

specify confidence interval object order as 'alpha' or 'numeric' for alphabetical or numerical ordering in the 'group' graph.

gcol

pick confidence interval line colors for groups in the 'group' graph. Default is 'blue'.

gband

logical TRUE or FALSE that indicates whether group lines have confidence bands for trend over time results. Default is FALSE.

pcol

select point color for 'group' only confidence intervals. Default is 'red'.

overall

logical TRUE or FALSE that indicates whether to include the overall sample confidence intervals (i.e., not each group). Default is FALSE.

ocol

indicate the optional overall line color. Default is 'gray' when overall=TRUE.

oband

logical TRUE or FALSE that indicates whether to add an overall confidence band. Default is FALSE.

tgt

specify 1 or more values on the x-axis of where to add a target line. Default is NULL.

tcol

select a color for the target line. Default is 'gray'.

tpline

add one or time point vertical line(s) using x-axis values when y='time' or y='roll'. Default is NULL.

tpcol

specify a color for the time point line, tpline. Default is NULL.

xlim

specify plot's x-axis limits with a 2 value vector.

ylim

specify plot's y-axis limits with a 2 value vector.

main

the main title of the plot.

lwd

select the line width. Default is 1.

adj.alpha

factor modifying the opacity alpha of the confidence interval bands, in the range of 0 to 1. Default is 0.4.

cex

A numerical value giving the amount by which plotting text and symbols should be magnified relative to the default of 1.

cex.axis

The magnification to be used for axis annotation relative to the current setting of cex. Default is 1.

cex.lab

The magnification to be used for x and y labels relative to the current setting of cex. Default is 1.

cex.main

The magnification to be used for main titles relative to the current setting of cex. Default is 1.

cex.text

The magnification to be used for the text added into the plot relative to the current setting of 1.

round.c

an integer indicating the number of decimal places. Default is 2. to be used for rounding coefficient values.

name

logical TRUE or FALSE that indicates whether group names should be added to the 'time' or 'roll' plots. Default is FALSE.

abbrv

the minimum length of the abbreviations. Default is 5.

...

additional arguments.

Examples

Run this code
#Simple graph for confidence intervals using the t-distribution
gr1 <- group(x="program", y="los", z="month", dataf=hosprog, dist="t",
increment=3, rolling=6)
# Group level confidence intervals
plot(x=gr1, y="group", order="numeric", lwd=4, gcol= "blue", pcol="red",
overall=TRUE, oband=TRUE, ocol="gray", tcol="green", tgt=4.5,
cex=1, cex.axis=1, cex.lab=1, cex.text=2,
cex.main=1.25, name=TRUE, adj.alpha=.2)
#Trend plots over time in the 3 month increments (i.e., quarters)
plot(x=gr1, y="time", lwd=4, gcol=c("red", "blue"), gband=TRUE, overall=TRUE,
  oband=TRUE, ocol="gray", tcol="green", tgt=4, tpline=3,
  tpcol="yellow", name=TRUE, cex.axis=1, cex.lab=1, cex.text=2,
  cex.main=1.25, adj.alpha=.3)
#Plot for rolling 6-month averages
plot(x=gr1, y="roll", lwd=4, gcol=c("red", "blue"), gband=TRUE, overall=TRUE,
  oband=TRUE, ocol="gray", tcol="green", tgt=4, tpline=c(4,6),
  tpcol="yellow", name=TRUE, cex.axis=1, cex.lab=1, cex.text=2,
  cex.main=1.25, adj.alpha=.3)

Run the code above in your browser using DataLab