[−][src]Struct mathru::statistics::test::T
T-Test
Fore more information: https://en.wikipedia.org/wiki/Student%27s_t-test
Example
use mathru::{ self, statistics::{ distrib::{Distribution, Normal}, test::{Test, T}, }, }; let rv1 = Normal::new(1.0, 0.5).random_sequence(100); let rv2 = Normal::new(1.0, 0.5).random_sequence(100); //Test with sample with identical means let mut measure: T<f64> = T::test_independence_unequal_variance(&rv1, &rv2); println!("{}", measure.value()); measure = T::test_independence_equal_variance(&rv1, &rv2); println!("{}", measure.value()); // Test with different equal mean, but unequal variances let rv3 = Normal::new(1.0, 1.5).random_sequence(100); measure = T::test_independence_unequal_variance(&rv1, &rv3); println!("{}", measure.value()); measure = T::test_independence_equal_variance(&rv1, &rv3); println!("{}", measure.value()); // When the sample size is not equal anymore //the equal variance t-statistic is no longer equal to the unequal variance t-statistic: let rv4 = Normal::new(2.0, 0.5).random_sequence(300); measure = T::test_independence_unequal_variance(&rv1, &rv4); println!("{}", measure.value()); measure = T::test_independence_equal_variance(&rv1, &rv4); println!("{}", measure.value()); //t-Test with different mean, variance and sample size let rv5 = Normal::new(2.0, 1.0).random_sequence(300); measure = T::test_independence_unequal_variance(&rv1, &rv5); println!("{}", measure.value()); measure = T::test_independence_equal_variance(&rv1, &rv5); println!("{}", measure.value());
Implementations
impl<K> T<K> where
K: Real + Gamma + Beta + Error + Hypergeometric,
[src]
K: Real + Gamma + Beta + Error + Hypergeometric,
pub fn one_sample(x: &Vec<K>, mu_0: K) -> T<K>
[src]
This is a one-sided test for the null hypothesis that the expected value (mean) of a sample of independent observations a is equal to the given mean.
x: observation
pub fn test_independence_equal_variance(x: &Vec<K>, y: &Vec<K>) -> T<K>
[src]
Calculates the T-test for the means of two independent samples of scores
This is a two-sided test for the null hypothesis that two independent samples have identical expected values. It is assumed, that the populations have identical variances.
pub fn test_independence_unequal_variance(x: &Vec<K>, y: &Vec<K>) -> T<K>
[src]
Calculates the T-test for the means of two independent samples of scores
This is a two-sided test for the null hypothesis that two independent samples have identical expected values. It is assumed, that the populations have NOT identical variances. It performs the Welch’s t-test
Trait Implementations
impl<K: Clone> Clone for T<K>
[src]
impl<K: Copy> Copy for T<K>
[src]
impl<K: Debug> Debug for T<K>
[src]
impl<'de, K> Deserialize<'de> for T<K> where
K: Deserialize<'de>,
[src]
K: Deserialize<'de>,
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<K> Serialize for T<K> where
K: Serialize,
[src]
K: Serialize,
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<K> Test<K> for T<K> where
K: Real,
[src]
K: Real,
Auto Trait Implementations
impl<K> RefUnwindSafe for T<K> where
K: RefUnwindSafe,
K: RefUnwindSafe,
impl<K> Send for T<K> where
K: Send,
K: Send,
impl<K> Sync for T<K> where
K: Sync,
K: Sync,
impl<K> Unpin for T<K> where
K: Unpin,
K: Unpin,
impl<K> UnwindSafe for T<K> where
K: UnwindSafe,
K: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,