Package 'ConfidenceEllipse'

Title: Computation of 2D and 3D Elliptical Joint Confidence Regions
Description: Computing elliptical joint confidence regions at a specified confidence level. It provides the flexibility to estimate either classical or robust confidence regions, which can be visualized in 2D or 3D plots. The classical approach assumes normality and uses the mean and covariance matrix to define the confidence regions. Alternatively, the robustified version employs estimators like minimum covariance determinant (MCD) and M-estimator, making them less sensitive to outliers and departures from normality. Furthermore, the functions allow users to group the dataset based on categorical variables and estimate separate confidence regions for each group. This capability is particularly useful for exploring potential differences or similarities across subgroups within a dataset. Varmuza and Filzmoser (2009, ISBN:978-1-4200-5947-2). Johnson and Wichern (2007, ISBN:0-13-187715-1). Raymaekers and Rousseeuw (2019) <DOI:10.1080/00401706.2019.1677270>.
Authors: Christian L. Goueguel [aut, cre]
Maintainer: Christian L. Goueguel <[email protected]>
License: MIT + file LICENSE
Version: 1.0.0
Built: 2025-03-01 03:05:44 UTC
Source: https://github.com/christiangoueguel/confidenceellipse

Help Index


Confidence Ellipse Coordinates

Description

Compute the coordinate points of confidence ellipses at a specified confidence level.

Usage

confidence_ellipse(
  .data,
  x,
  y,
  .group_by = NULL,
  conf_level = 0.95,
  robust = FALSE
)

Arguments

.data

data frame or tibble.

x

column name for the x-axis variable.

y

column name for the y-axis variable.

.group_by

column name for the grouping variable (NULL by default). Note that this grouping variable must be a factor.

conf_level

confidence level for the ellipse (0.95 by default).

robust

optional (FALSE by default). When set to TRUE, it indicates that robust estimation method is employed to calculate the coordinates of the ellipse. The location is the 1-step M-estimator with the biweight psi function. The scale is the Minimum Covariance Determinant (MCD) estimator. Raymaekers and Rousseeuw (2019).

Value

Data frame of the coordinates points.

Author(s)

Christian L. Goueguel

Examples

# Data
data("glass", package = "ConfidenceEllipse")
# Confidence ellipse
ellipse <- confidence_ellipse(.data = glass, x = SiO2, y = Na2O)
ellipse_grp <- confidence_ellipse(
.data = glass,
x = SiO2,
y = Na2O,
.group_by = glassType
)

Confidence Ellipsoid Coordinates

Description

Compute the coordinate points of confidence ellipsoids at a specified confidence level.

Usage

confidence_ellipsoid(
  .data,
  x,
  y,
  z,
  .group_by = NULL,
  conf_level = 0.95,
  robust = FALSE
)

Arguments

.data

data frame or tibble.

x

column name for the x-axis variable.

y

column name for the y-axis variable.

z

column name for the z-axis variable.

.group_by

column name for the grouping variable (NULL by default). Note that this grouping variable must be a factor.

conf_level

confidence level for the ellipsoid (0.95 by default).

robust

optional (FALSE by default). When set to TRUE, it indicates that robust estimation method is employed to calculate the coordinates of the ellipsoid. The location is the 1-step M-estimator with the biweight psi function. The scale is the Minimum Covariance Determinant (MCD) estimator. Raymaekers and Rousseeuw (2019).

Value

Data frame of the coordinate points.

Author(s)

Christian L. Goueguel

Examples

# Data
data("glass", package = "ConfidenceEllipse")
# Confidence ellipsoid
ellipsoid <- confidence_ellipsoid(.data = glass, x = SiO2, y = Na2O, z = Fe2O3)
ellipsoid_grp <- confidence_ellipsoid(
.data = glass,
x = SiO2,
y = Na2O,
z = Fe2O3,
.group_by = glassType
)

Glass Vessels Data

Description

The dataset is comprised of 13 different measurements for 180 archaeological glass vessels from different groups (Janssen, K.H.A., De Raedt, I., Schalm, O., Veeckman, J.: Microchim. Acta 15 (suppl.) (1998) 253-267. Compositions of 15th - 17th century archaeological glass vessels excavated in Antwerp.).

Usage

glass

Format

Data frame of 180 rows and 14 columns.