Learn R Programming

dataSDA (version 0.1.8)

interval_position: Position and Scale Measures for Interval Data

Description

Functions to compute position and scale statistics for interval-valued data.

Usage

int_median(x, var_name, method = "CM", ...)

int_quantile(x, var_name, probs = c(0.25, 0.5, 0.75), method = "CM", ...)

int_range(x, var_name, method = "CM", ...)

int_iqr(x, var_name, method = "CM", ...)

int_mad(x, var_name, method = "CM", ...)

int_mode(x, var_name, method = "CM", breaks = 30, ...)

Value

A numeric matrix or value

Arguments

x

interval-valued data with symbolic_tbl class.

var_name

the variable name or the column location (multiple variables are allowed).

method

methods to calculate statistics: CM (default), VM, QM, SE, FV, EJD, GQ, SPT.

...

additional parameters

probs

numeric vector of probabilities with values in [0,1].

breaks

number of histogram breaks for mode estimation (default: 30).

Author

Han-Ming Wu

Details

These functions provide position and scale measures:

  • int_median: Median of interval data

  • int_quantile: Quantiles of interval data

  • int_range: Range (max - min) of interval data

  • int_iqr: Interquartile range (Q3 - Q1)

  • int_mad: Median absolute deviation

See Also

int_mean int_var int_median int_quantile

Examples

Run this code
data(mushroom.int)

# Calculate median
int_median(mushroom.int, var_name = "Pileus.Cap.Width")
int_median(mushroom.int, var_name = 2:3, method = c("CM", "EJD"))

# Calculate quantiles
int_quantile(mushroom.int, var_name = 2, probs = c(0.25, 0.5, 0.75))

# Calculate interquartile range
int_iqr(mushroom.int, var_name = c("Stipe.Length", "Stipe.Thickness"))

# Calculate MAD
int_mad(mushroom.int, var_name = 2:3, method = "CM")

Run the code above in your browser using DataLab