HyperMath

TTest2

TTest2

Previous topic Next topic No expanding text in this topic  

TTest2

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

Tests samples from two normally distributed populations with the same standard deviation to determine if the hypothesis that the population means are equal should be accepted or rejected.

Syntax

reject, p_value, conf = TTest2(data1, data2, alpha)

Arguments

Name

Description

 

data1

A vector containing sample data.

 

data2

A vector containing sample data.

 

alpha

(optional)

The level of significance for the test, also known as the probability of a Type I error.  It must be in the interval (0, 0.5).  The default value is 0.05.

Outputs

Name

Description

 

reject

A Boolean value that is true if the hypothesis is to be rejected.

 

p_value

The largest value of alpha for which the hypothesis is to be accepted.

 

conf

A 100(1-alpha)% confidence interval for the difference between the population means (subtracting the first from the second).  A two element vector containing the lower and upper bounds of the interval, respectively.

Example

Test the hypothesis that the samples [2, 3, 5, 7, 4] and [4, 8, 6, 3] come from populations with equal means, given that they have equal standard deviations.

 

Syntax

 

reject, p_value, conf = TTest2([2, 3, 5, 7, 4], [4, 8, 6, 3])

 

Result

 

reject = false

p_value = 0.47105

conf = [-4.3091    2.2091]