lh_boxplot2: BOXPLOT MC SIMULATION

View source: R/lhplot.R

lh_boxplot2R Documentation

BOXPLOT MC SIMULATION

Description

Generate boxplot with targets and stats

Usage

lh_boxplot2(
  data = sim[sim$freq == "BID", ],
  y.dat = "Cavg",
  x.dat = "AGEGRP",
  x.title = "",
  y.title = "",
  target = c(100, 320),
  add.obs.point = "no",
  add.stats = "no",
  stat.label.space = c(0.1, 0.2),
  min.y = 0,
  max.y = 1000,
  increm.y = 100,
  box.stats = c("quantile(x,0.05)", "quantile(x,0.25)", "quantile(x,0.5)",
    "quantile(x,0.75)", "quantile(x,0.95)"),
  box.target = NULL,
  jit = c(0.1, 0.1),
  targ.line.size = 1,
  targ.text.size = 3,
  targ.text.col = c("blue", "green4", "red"),
  targ.line.col = c("blue", "red"),
  color.target.cutoff = "median(x)",
  outlier = "no",
  transparency = 0.5,
  obs.color = "grey",
  obs.size = 1,
  target.line.type = NULL,
  legend.title = "Target Attainment",
  targ.legend = c("below lower", "within lower and upper", "above upper")
)

Arguments

data

data frame

y.dat

y and x (x.dat) data

target

set target values. Two values are required, use the same value for single target cutoff.

add.obs.point

set Yes to display observed data

add.stats

set to yes for displaying percentage of individual who attained each target

stat.label.space

adjust spacing between each stats in the figure

min.y

set minimum value of y axis

max.y

set maximum value of y axis. Use this parameter for setting the lower boundary of the stats values in the figure

increm.y

set y axis ticks

box.stats

specify the function for lower whisker, min, mid, max box, and upper whisker value. NUll for standard values (med-1.5IQR,25th,50th,75th,med+1.5*IQ)

box.target

NULL to use keep the same target as in target parameter.

targ.line.size

adjust stats text to display on top (also, targ.text.size, targ.text.col,targ.line.col)

color.target.cutoff

specify the cutoff value for color box. Use numeric value of stats function.

targ.legend

change legend description of each box color

Examples

lh_boxplot2(data=rall,
y.dat="Cmaxss",
x.dat="Label",
x.title="Group",
y.title="AUCss",
low.targ.line=rf$Cmaxsslow,
high.targ.line=rf$Cmaxsshi,
add.target="yes",
add.obs.point="yes", tips: GE>= (\+U2265), LE<= (\+U2264)
add.stats="yes",
stat.label.space=c(0.1,0.2),jit=c(0.15,0)) +theme_bw()+ theme(axis.text.x #'
= element_text(angle = 45, hjust = 1))+scale_y_log10()

leonpheng/lhplot documentation built on April 13, 2025, 1:48 p.m.