ggbootUV: Univariate bootstrap plot

Description Usage Arguments Value

View source: R/ggbootUV.R

Description

Plots a sample statistic, such as the mean or median, and associated bootstrapped 95% confidence intervals for specified subsets of observations. Facilitates hypothesis testing by allowing a) application of the Benjamini-Hochberg procedure to control the alse discovery rate and b) specification of a minimum effect size.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
ggbootUV(data, resp, xAxis, col = NULL, facet = NULL, diff = NULL,
  calcStat = mean, B = 10, alpha = 0.05, nSide = 1, altSide,
  method = "bca", fdr = 0.01, minEff = 0, hLineVec = NULL,
  nullValue = 0, xLab = NULL, yLab = "Response", xAxisLabVec = NULL,
  rotXText = FALSE, remXAxisMarks = FALSE, pointSize = 2,
  errBarSize = 1, errBarSizeRatio = 2, errBarAlpha = 0.7,
  errBarAlphaRatio = 2, eqErrBarWidth = TRUE, colLabName = NULL,
  colourVec = c("darkorchid1", "springgreen2", "maroon1", "dodgerblue", "red",
  "yellow3", "cyan2", "orange2"), colLabVec = NULL, facetLabVec = NULL,
  facetScale = "free", nCol = 2, plotTblName = NULL,
  sigIndType = "lineType", fontScaleFactor = 1)

Arguments

data

dataframe. Has one row per observation and the column names specified below.

resp

unquoted expression. Response variable name.

xAxis

unquoted expression. X-axis variable name.

col

unquoted expression. Colour variable name.

facet

unquoted expression. Facet variable name.

diff

unquoted expression. Difference variable name. Must be a binary variable, preferrably ('0','1') as then it is clear that the difference is the amount by which the observations labelled '1' are greater than the observations labelled '0'.

calcStat

function olr character. Bootstrap statistic function. Functions other than mean or median used at own risk.

B

integer. Number of bootstrap samples per subgroup.

alpha

numeric. 1-alpha is the coverage of the confidence intervals.

nSide

1 or 2. Number of sides of the hypothesis tests.

method

'bca' for BCa or 'perc' for percentile. Bootstrap confidence interval and p-value method.

fdr

numeric. False discovery rate.

minEff

numeric. Minimum effect size. Default is 0.

hLineVec

numeric vector. Heights of dashed horizontal lines to plot. Useful for indicating minimum effect size.

nullValue

numeric. Null hypothesis value for statistic.

xLab, yLab

characeter. X- and y-axis titles. Optional.

xAxisLabVec

named character vector. Labels for x-axis variable. Optional.

rotXText

logical. If TRUE, then the x-axis text is rotated 90 degrees clockwise.

remXAxisMarks

logical. If TRUE, then the x-axis ticks and text are removed.

pointSize

numeric. Size of plot points

errBarSize

numeric. Size of error bar

errBarSizeRatio

numeric. How many times larger the size is of the statistically significant error bars than the non-statistically significant bars are.

errBarAlpha

numeric. Error bar alpha

errBarAlphaRatio

numeric. How many times greater the alpha is of the statistically significant error bars than the non-statistically significant bars are.

eqErrBarWidth

logical. If TRUE, then the error bars are made the same width in each facet. Otherwise the error bars automatically span the entire facet, however many x-axis entries there are.

colLabName

character. Name for colour legend. Optional.

colourVec

character vector. Colours for colour scale. Optional. Label with factor levels to match levels to colours manually.

colLabVec

named character vector. Labels for colour variable. Optional.

facetScale

'free', 'free_x' or 'free_y'. Facet scale.

nCol

numeric. Number of columns to use.

plotTblName

character. If not NULL, then the dataframe used to plot is saved to global environment with name plotTblName.

sigIndType

character vector. Must contain at least one of "lineType", "alpha" and "size". The statistically significant and non-statistically significant error bars will then differ by this aesthetic.

fontScaleFactor

integer. Factor by which to scale the text size from the default.

altSde

'high', 'low' or 'both'. Character specifying the alternative hypothesis relative to the null hypothesis. Note that you must still specify nSide, even if altSide is specified.

facetlabeVec

named character vector. Labels for facet fariable. Optional.

Value

a ggplot2 object


MiguelRodo/ggboot documentation built on May 1, 2018, 12:22 a.m.