Ttest2e: Difference between revisions

From EVRI Test Wiki 02192024
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
 
imported>Jeremy
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
===Purpose===
===Purpose===
Two sample t-test (assuming equal variance).
Two sample t-test (assuming equal variance).
===Synopsis===
===Synopsis===
:result = ttest2e(x,y,''test'')
:result = ttest2e(x,y,''test'')
===Description===
===Description===
Calculates a two sample t-test for samples (x) and (y) assuming equal variance.
Calculates a two sample t-test for samples (x) and (y) assuming equal variance.
INPUTS:
 
* x = matrix (column vector) in which the sample data is stored.
====Inputs====
* y = matrix (column vector) in which the sample data is stored.
 
* ttest = [-1,{0},1] indicates what ttest is for:
* '''x''' = matrix (column vector) in which the sample data is stored.
*   -1 - lower tail  H0: mean(x) <= mean(y)
 
*   0 - wo-tail    H0: mean(x) \~= mean(y) {default}
* '''y''' = matrix (column vector) in which the sample data is stored.
*   1 - upper tail  H0: mean(x) >= mean(y)
 
OUTPUTS:
* '''ttest''' = [-1,{0},1] indicates what ttest is for:
 
::   '''-1''' - lower tail  H0: mean(x) <= mean(y)
::   '''0''' - wo-tail    H0: mean(x) \~= mean(y) {default}
::   '''1''' - upper tail  H0: mean(x) >= mean(y)
 
====Outputs====
 
The output (result) a structure with the following fields:
The output (result) a structure with the following fields:
* t = test statistic.
 
* p = probability value
* '''t''' = test statistic.
* mean1 = mean of x
 
* mean2 = mean of y
* '''p''' = probability value
* var1 = variance of x  
 
* var2 = variance of y
* '''mean1''' = mean of x
* n1 =  length of x  
 
* n2 =  length of y
* '''mean2''' = mean of y
* pse = pooled standard error
 
* df = degress of freedom  
* '''var1''' = variance of x  
* hyp =  hypothesis being tested
 
* '''var2''' = variance of y
 
* '''n1''' =  length of x  
 
* '''n2''' =  length of y
 
* '''pse''' = pooled standard error
 
* '''df''' = degress of freedom  
 
* '''hyp''' =  hypothesis being tested
 
===Examples===
===Examples===
result = ttest2e(x,y);
 
result = ttest2e(x,y,test);
  result = ttest2e(x,y);
 
  result = ttest2e(x,y,test);
 
===See Also===
===See Also===
[[ttest1]], [[ttest2u]], [[ttest2p]]
[[ttest1]], [[ttest2u]], [[ttest2p]]

Latest revision as of 11:27, 9 October 2008

Purpose

Two sample t-test (assuming equal variance).

Synopsis

result = ttest2e(x,y,test)

Description

Calculates a two sample t-test for samples (x) and (y) assuming equal variance.

Inputs

  • x = matrix (column vector) in which the sample data is stored.
  • y = matrix (column vector) in which the sample data is stored.
  • ttest = [-1,{0},1] indicates what ttest is for:
-1 - lower tail H0: mean(x) <= mean(y)
0 - wo-tail H0: mean(x) \~= mean(y) {default}
1 - upper tail H0: mean(x) >= mean(y)

Outputs

The output (result) a structure with the following fields:

  • t = test statistic.
  • p = probability value
  • mean1 = mean of x
  • mean2 = mean of y
  • var1 = variance of x
  • var2 = variance of y
  • n1 = length of x
  • n2 = length of y
  • pse = pooled standard error
  • df = degress of freedom
  • hyp = hypothesis being tested

Examples

 result = ttest2e(x,y);
 result = ttest2e(x,y,test);

See Also

ttest1, ttest2u, ttest2p