stat_abszdensity: ggplot2 density lines for absolute z-statistics assuming that...

Description Usage Arguments Computed variables

View source: R/density_absz.R

Description

Unlike normal [geom_density] or [stat_density] the density estimate does not go artificially decrease at the left bound 0. Note that this function only works nicely if the data starts left with 0. Possibly atoms at z=0 should ideally be removed.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
stat_abszdensity(
  mapping = NULL,
  data = NULL,
  geom = "line",
  position = "stack",
  ...,
  bw = "nrd0",
  adjust = 1,
  kernel = "epanechnikov",
  n = 512,
  trim = FALSE,
  na.rm = FALSE,
  orientation = NA,
  show.legend = NA,
  inherit.aes = TRUE
)

Arguments

bw

The smoothing bandwidth to be used. If numeric, the standard deviation of the smoothing kernel. If character, a rule to choose the bandwidth, as listed in [stats::bw.nrd()].

adjust

A multiplicate bandwidth adjustment. This makes it possible to adjust the bandwidth while still using the a bandwidth estimator. For example, 'adjust = 1/2' means use half of the default bandwidth.

kernel

Kernel. See list of available kernels in [density()].

n

number of equally spaced points at which the density is to be estimated, should be a power of two, see [density()] for details

trim

If 'FALSE', the default, each density is computed on the full range of the data. If 'TRUE', each density is computed over the range of that group: this typically means the estimated x values will not line-up, and hence you won't be able to stack density values. This parameter only matters if you are displaying multiple densities in one plot or if you are manually adjusting the scale limits.

Computed variables

density

density estimate

count

density * number of points - useful for stacked density plots

scaled

density estimate, scaled to maximum of 1

ndensity

alias for 'scaled', to mirror the syntax of ['stat_bin()']


skranz/RoundingMatters documentation built on Dec. 23, 2021, 3:23 a.m.