Ttest2u: Difference between revisions
Jump to navigation
Jump to search
imported>Jeremy |
imported>Neal |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
===Synopsis=== | ===Synopsis=== | ||
:result = ttest2u(x,y,''test,dfapp'') | :result = ttest2u(x,y); | ||
:result = ttest2u(x,y,''test,dfapp''); | |||
===Description=== | ===Description=== | ||
Line 13: | Line 14: | ||
====Inputs==== | ====Inputs==== | ||
* '''x''' = matrix (column vector) | * '''x''' = matrix (or column vector) of data for the first sample. | ||
* '''y''' = matrix (or column vector) of data for the second sample. | |||
* '''y''' = | ====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. | |||
* '''dfapp''' = [{-1}, 1] | |||
:: '''-1''' | |||
:: '''1''' | |||
====Outputs==== | ====Outputs==== | ||
* '''result''' = a structure with the following fields: | |||
:* '''t''': test statistic, | |||
* '''t''' | :* '''p''': probability value, | ||
:* '''mean1''': mean of x, | |||
* '''p''' | :* '''mean2''': mean of y, | ||
:* '''var1''': variance of x, | |||
* '''mean1''' | :* '''var2''': variance of y, | ||
:* '''n1''': length of x, | |||
* '''mean2''' | :* '''n2''': length of y, | ||
:* '''pse''': pooled standard error, | |||
* '''var1''' | :* '''df''': degress of freedom, | ||
:* '''app''': 'Satterthwaite' or 'Welch', | |||
* '''var2''' | :* '''hyp''': hypothesis being tested. | ||
* '''n1''' | |||
* '''n2''' | |||
* '''pse''' | |||
* '''df''' | |||
* '''app''' | |||
* '''hyp''' | |||
===See Also=== | ===See Also=== | ||
[[ttest1]], [[ | [[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.