Enum stats_ci::Confidence
source · pub enum Confidence {
TwoSided(f64),
UpperOneSided(f64),
LowerOneSided(f64),
}Expand description
Confidence level of a confidence interval.
Examples
To create a two-sided confidence interval with 95% confidence:
let confidence = Confidence::new_two_sided(0.95);To create an upper one-sided confidence interval with 90% confidence:
let confidence = Confidence::new_upper(0.9);To create a lower one-sided confidence interval with 99% confidence:
let confidence = Confidence::new_lower(0.99);Variants§
TwoSided(f64)
Confidence for a two-sided interval.
UpperOneSided(f64)
Confidence for an upper one-sided interval.
LowerOneSided(f64)
Confidence for a lower one-sided interval.
Implementations§
source§impl Confidence
impl Confidence
sourcepub fn new_two_sided(confidence: f64) -> Self
pub fn new_two_sided(confidence: f64) -> Self
sourcepub fn level(&self) -> f64
pub fn level(&self) -> f64
Return the confidence level of the interval as a number in the range (0, 1).
sourcepub fn kind(&self) -> &'static str
pub fn kind(&self) -> &'static str
Return the kind of the confidence interval as a string (in English).
sourcepub fn is_two_sided(&self) -> bool
pub fn is_two_sided(&self) -> bool
Test if the confidence interval is two-sided.
sourcepub fn is_one_sided(&self) -> bool
pub fn is_one_sided(&self) -> bool
Test if the confidence interval is one-sided.
sourcepub fn flipped(&self) -> Self
pub fn flipped(&self) -> Self
Return the confidence interval with the same confidence level but flipped. For a two-sided interval, this is the same interval. For a one-sided interval, this is the interval with the opposite direction. For example, a lower one-sided interval with confidence 0.95 flipped is an upper one-sided interval with confidence 0.95.
Trait Implementations§
source§impl Clone for Confidence
impl Clone for Confidence
source§fn clone(&self) -> Confidence
fn clone(&self) -> Confidence
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for Confidence
impl Debug for Confidence
source§impl Default for Confidence
impl Default for Confidence
source§impl PartialEq<Confidence> for Confidence
impl PartialEq<Confidence> for Confidence
source§fn eq(&self, other: &Confidence) -> bool
fn eq(&self, other: &Confidence) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd<Confidence> for Confidence
impl PartialOrd<Confidence> for Confidence
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§impl TryFrom<f32> for Confidence
impl TryFrom<f32> for Confidence
source§impl TryFrom<f64> for Confidence
impl TryFrom<f64> for Confidence
impl Copy for Confidence
impl StructuralPartialEq for Confidence
Auto Trait Implementations§
impl RefUnwindSafe for Confidence
impl Send for Confidence
impl Sync for Confidence
impl Unpin for Confidence
impl UnwindSafe for Confidence
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.