Ttest2u: Difference between revisions
Jump to navigation
Jump to search
imported>Jeremy (Importing text file) |
imported>Jeremy (Importing text file) |
||
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,''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==== | ====INPUTS==== | ||
* '''x''' = matrix (column vector) in which the sample data is stored. | * '''x''' = matrix (column vector) in which the sample data is stored. | ||
* '''y''' = 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: | * '''ttest''' = [-1,{0},1] indicates what ttest is for: | ||
* '''-1''' - lower tail H0: mean(x) <= mean(y) | * '''-1''' - lower tail H0: mean(x) <= mean(y) | ||
* '''0''' - wo-tail H0: mean(x) \~= mean(y) {default} | * '''0''' - wo-tail H0: mean(x) \~= mean(y) {default} | ||
* '''1''' - upper tail H0: mean(x) >= mean(y) | * '''1''' - upper tail H0: mean(x) >= mean(y) | ||
* '''dfapp''' = [{-1}, 1] indicates which degree of freedom calculation to use. | * '''dfapp''' = [{-1}, 1] indicates which degree of freedom calculation to use. | ||
* '''-1''' - indicates Welch's approximate degrees of freedom {default} | * '''-1''' - indicates Welch's approximate degrees of freedom {default} | ||
* '''1''' - indicates Satterthwaite's approximate degrees of freedom | * '''1''' - indicates Satterthwaite's approximate degrees of freedom | ||
====OUTPUTS==== | ====OUTPUTS==== | ||
The output (result) a structure with the following fields: | The output (result) a structure with the following fields: | ||
* '''t''' = test statistic. | * '''t''' = test statistic. | ||
* '''p''' = probability value | * '''p''' = probability value | ||
* '''mean1''' = mean of x | * '''mean1''' = mean of x | ||
* '''mean2''' = mean of y | * '''mean2''' = mean of y | ||
* '''var1''' = variance of x | * '''var1''' = variance of x | ||
* '''var2''' = variance of y | * '''var2''' = variance of y | ||
* '''n1''' = length of x | * '''n1''' = length of x | ||
* '''n2''' = length of y | * '''n2''' = length of y | ||
* '''pse''' = pooled standard error | * '''pse''' = pooled standard error | ||
* '''df''' = degress of freedom | * '''df''' = degress of freedom | ||
* '''app''' = 'Satterthwaite' or 'Welch' | * '''app''' = 'Satterthwaite' or 'Welch' | ||
* '''hyp''' = hypothesis being tested | * '''hyp''' = hypothesis being tested | ||
===Examples=== | ===Examples=== | ||
result = ttest2u(x,y); | result = ttest2u(x,y); | ||
result = ttest2u(x,y,test); | result = ttest2u(x,y,test); | ||
result = ttest2e(x,y,test,dfapp); | result = ttest2e(x,y,test,dfapp); | ||
===See Also=== | ===See Also=== | ||
[[ttest1]], [[ttest2u]], [[ttest2p]] | [[ttest1]], [[ttest2u]], [[ttest2p]] | ||
*''''''''' ''' | *''''''''' ''' |
Revision as of 15:27, 3 September 2008
Purpose
Two sample t-test (assuming unequal variance).
Synopsis
- result = ttest2u(x,y,test,dfapp)
Description
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.
- 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)
- dfapp = [{-1}, 1] indicates which degree of freedom calculation to use.
- -1 - indicates Welch's approximate degrees of freedom {default}
- 1 - indicates Satterthwaite's approximate degrees of freedom
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
- app = 'Satterthwaite' or 'Welch'
- hyp = hypothesis being tested
Examples
result = ttest2u(x,y);
result = ttest2u(x,y,test);
result = ttest2e(x,y,test,dfapp);
See Also
- ''''