Skip to contents

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

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
)