get95CIellipse: Calculate surface area of a confidence ellipse on 2D data.

View source: R/statistics.R

get95CIellipseR Documentation

Calculate surface area of a confidence ellipse on 2D data.

Description

This function uses PCA to calculate the standard deviation across the two main axes of the spread of 2D data. Multiplying that length-2 vector by 'pi' and the confidence level gives the surface area of an ellipse that will contain the mean in some percentage of cases. This relies on the data being in the same unit, and makes most sense if it is real data (such as locations in a cartesian coordinate system).

Usage

get95CIellipse(df, vars = NULL, conf.level = 0.95)

Arguments

df

A data frame, with (at least) 2 variables with the same unit.

vars

A list of column to use in the data frame, if 'df' has more than 2 columns.

conf.level

The level of confidence to use. Default is 0.95.

Details

Not yet.

Value

The surface area of an ellipse that contains the mean of the data in 95% of replications of the same experiment.


thartbm/handlocs documentation built on Feb. 18, 2025, 10:53 p.m.