Ttest2u: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
imported>Neal
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
===Purpose===
===Purpose===
Two sample t-test (assuming unequal variance).
Two sample t-test (assuming unequal variance).
===Synopsis===
===Synopsis===
:result = ttest2u(x,y,''test,dfapp'')
 
:result = ttest2u(x,y);
:result = ttest2u(x,y,''test,dfapp'');
 
===Description===
===Description===
Calculates a two sample t-test for samples (x) and (y) assuming unequal variance.
Calculates a two sample t-test for samples (x) and (y) assuming unequal 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 (or column vector) of data for the first sample.
*   '''-1''' - lower tail  H0: mean(x) <= mean(y)
* '''y''' = matrix (or column vector) of data for the second sample.
*   '''0''' - wo-tail     H0: mean(x) \~= mean(y) {default}
 
*   '''1''' - upper tail  H0: mean(x) >= mean(y)
====Optional Inputs====
* '''dfapp''' = [{-1}, 1] indicates which degree of freedom calculation to use.
* '''ttest''' = [-1, {0} ,1] indicates what type of t-test to perform:
*   '''-1''' - indicates Welch's approximate degrees of freedom {default}
::   '''-1''': lower tail  H0: mean(x) <= mean(y),
*   '''1''' - indicates Satterthwaite's approximate degrees of freedom
::   ''' 0''': two-tail   H0: mean(x) ~= mean(y) {default},
====OUTPUTS====
::   ''' 1''': upper tail  H0: mean(x) >= mean(y).
The output (result) a structure with the following fields:
 
* '''t''' = test statistic.
* '''dfapp''' = [ {-1} , 1] governs the algorithm for calculating degrees of freedom:
* '''p''' = probability value
::   '''-1''': Welch's approximate degrees of freedom {default},
* '''mean1''' = mean of x
::   ''' 1''': Satterthwaite's approximate degrees of freedom.
* '''mean2''' = mean of y
 
* '''var1''' = variance of x  
====Outputs====
* '''var2''' = variance of y
 
* '''n1''' = length of x  
* '''result''' = a structure with the following fields:
* '''n2''' = length of y
:* '''t''': test statistic,
* '''pse''' = pooled standard error
:* '''p''': probability value,
* '''df''' = degress of freedom  
:* '''mean1''': mean of x,
* '''app''' = 'Satterthwaite' or 'Welch'
:* '''mean2''': mean of y,
* '''hyp''' = hypothesis being tested
:* '''var1''': variance of x,
===Examples===
:* '''var2''': variance of y,
result = ttest2u(x,y);
:* '''n1''': length of x,
result = ttest2u(x,y,test);
:* '''n2''': length of y,
result = ttest2e(x,y,test,dfapp);
:* '''pse''': pooled standard error,
:* '''df''': degress of freedom,
:* '''app''': 'Satterthwaite' or 'Welch',
:* '''hyp''': hypothesis being tested.
 
===See Also===
===See Also===
[[ttest1]], [[ttest2u]], [[ttest2p]]
 
*''''''''' '''
[[ttest1]], [[ttest2e]], [[ttest2p]]

Latest revision as of 09:42, 24 October 2013

Purpose

Two sample t-test (assuming unequal variance).

Synopsis

result = ttest2u(x,y);
result = ttest2u(x,y,test,dfapp);

Description

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

Inputs

  • x = matrix (or column vector) of data for the first sample.
  • y = matrix (or column vector) of data for the second sample.

Optional Inputs

  • ttest = [-1, {0} ,1] indicates what type of t-test to perform:
-1: lower tail H0: mean(x) <= mean(y),
0: two-tail H0: mean(x) ~= mean(y) {default},
1: upper tail H0: mean(x) >= mean(y).
  • dfapp = [ {-1} , 1] governs the algorithm for calculating degrees of freedom:
-1: Welch's approximate degrees of freedom {default},
1: Satterthwaite's approximate degrees of freedom.

Outputs

  • 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,
  • app: 'Satterthwaite' or 'Welch',
  • hyp: hypothesis being tested.

See Also

ttest1, ttest2e, ttest2p