CalcStandDevSkewedDistr: Calculate Standard Deviation for Skewed Distributions

View source: R/gruffi.R

CalcStandDevSkewedDistrR Documentation

Calculate Standard Deviation for Skewed Distributions

Description

Computes a modified standard deviation for skewed distributions by mirroring data points about the mean. This approach aims to reflect the skewed part of the distribution to better understand its spread.

Usage

CalcStandDevSkewedDistr(x, mean_x = mean(x), plothist = FALSE, breaks = 50)

Arguments

x

A numeric vector representing the distribution.

mean_x

The central tendency of x, used to mirror the distribution. Default is the mean of x.

plothist

Logical indicating whether to display histograms of the original, mirrored, and combined distributions. Default is FALSE.

breaks

The number of bins to use in the histogram if plotted. Default is 50.

Value

The estimated standard deviation for the skewed distribution.

Examples

set.seed(123)
skewed_data <- rexp(100, rate = 0.1)
# Calculate modified standard deviation without plotting
modified_sd <- stand_dev_skewed(skewed_data)

# Calculate and plot the distribution and its mirrored version
stand_dev_skewed(skewed_data, plothist = TRUE)


jn-goe/gruffi documentation built on Nov. 7, 2024, 10:38 p.m.