Package 'lettervalue'

Title: Computing Letter Values
Description: Letter Values for the course Exploratory Data Analysis at Federal University of Bahia (Brazil). The approach implemented in the package is presented in the textbook of Tukey (1977) <ISBN: 978-0201076165>.
Authors: Gilberto Sassi [aut, cre]
Maintainer: Gilberto Sassi <[email protected]>
License: MIT + file LICENSE
Version: 0.2.1
Built: 2025-01-23 02:38:01 UTC
Source: https://github.com/gilberto-sassi/lettervalue

Help Index


Compute Letter Value.

Description

letter_value returns the letter values until the level indicated by level.

Usage

letter_value(x, level = 2, na_rm = TRUE)

Arguments

x

numeric vector

level

integer value between 2 and 9 indicating the level to compute the letter values. Default value is 2.

na_rm

a logical evaluating to TRUE or FALSE indicating whether NA values should be stripped before the computation proceeds. Default value is TRUE.

Details

This function computes the letter values as presented at Understanding Robust and Exploratory Data Analysis by Hoaglin, Mosteller and Tukey published in 1983.

Value

a list object is returned with the variable name (variable_name), the sample (sample), and a data frame with the following columns:

letter

a letter indicating the letter value

depth

depth of the letter value

lv_lower

lower letter value

lv_upper

upper letter value

Examples

letter_value(rivers)

Display Letter Values.

Description

Display and return letter values.

Usage

## S3 method for class 'lv'
print(x, ...)

Arguments

x

an object lv.

...

further arguments passed to or from other methods.

Details

The diagram is, by default, the 5-number summary, where the sample size, the median (location measure) and the F-spread (distance between lower fourth and upper fourth). Others diagrams are avalaible increasing the argument level.

This function computes the letter values as presented at Understanding Robust and Exploratory Data Analysis by Hoaglin, Mosteller and Tukey published in 1983.

This is a generic print method for the class "lv".

Value

No return value, called to improve visualization of letter values as proposed at the seminal book Understanding Robust and Exploratory Data Analysis by Hoaglin, Mosteller and Tukey published of 1983.

Examples

lv_obj <- letter_value(rivers)
print.lv(lv_obj)

Summary Using Letter Value

Description

Compute the resume measures (location and scale) using letter values.

Usage

## S3 method for class 'lv'
summary(object, ..., coef = 1.5)

Arguments

object

an object lv.

...

further arguments passed to or from other methods.

coef

Length of the whiskers as multiple of IQR. Defaults to 1.

Details

In this summary, we present the trimean, median, F-spread, F-pseudo sigma, F-pseudo variance e outliers values.

This function returns the measures of location and scale as presented at Understanding Robust and Exploratory Data Analysis by Hoaglin, Mosteller and Tukey published in 1983.

This is a generic method for the class "lv".

Value

A tibble object with the following columns:

trimean

resistant measure to small changes in the dataset for location.

median

resistant measure to small changes in the datase for location.

f_spread

resistant measure to small changes in the dataset for scale.

f_pesudo_sigma

resistant measure to small changes in the dataset for location. For a normal distribution, this measure is equal to populational statndard deviation.

f_pseudo_variance

squared valued of f_pseudo_sigma.

outliers

values outside whiskers.

Examples

lv_obj <- letter_value(rivers)
summary.lv(lv_obj)