plot_hd_ci: Plot quantiles and confidence intervals

View source: R/marginal_plot.R

plot_hd_ciR Documentation

Plot quantiles and confidence intervals

Description

Using the output of quantiles_pbci, create a ggplot object showing specified quantiles (default to deciles) and their 95 bootstrap confidence intervals. A vertical line marks the median.

Usage

plot_hd_ci(
  data = out,
  qseq = seq(0.1, 0.9, 0.1),
  plotzero = TRUE,
  label.x = "Differences",
  hjust = -0.05,
  vjust = 0.2,
  size_text = 6,
  colour_q = "#009E73",
  fill_q = "white",
  size_q = 4,
  shape_q = 21,
  colour_line = "#009E73",
  size_line = 1,
  linetype_line = 2,
  colour_zero = "black",
  size_zero = 0.5,
  linetype_zero = 1
)

Arguments

data

Data frame created by 'quantiles_pbci'.

qseq

Sequence of quantiles to plot - assumes median is in the middle of the sequence - default = deciles.

See Also

quantiles_pbci

Examples

set.seed(7)
# make fake skewed data
x <- rgamma(100, shape=3, scale=1)*10+250
# compute quantiles and their percentile bootstrap confidence intervals
out <- quantiles_pbci(x,q=seq(1,9)/10,nboot=2000,alpha=0.05)
# make decile plot
p <- plot_hd_ci(data=out,plotzero=TRUE,label.x="Onsets in ms",
                   hjust=-.05,vjust=.5,size_text=5,
                   colour_dec = "grey10",fill_dec = "grey90",
                   colour_line = "grey10", linetype_line = 1, size_line = 1) +
                   scale_y_continuous(limits=c(250, 350),breaks=seq(250,350,25))


GRousselet/rogme documentation built on Nov. 12, 2022, 4:38 a.m.