Ttest2p: 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 paired t-test. | Two sample paired t-test. | ||
===Synopsis=== | ===Synopsis=== | ||
:result = ttest2e(x,y,''test'') | :result = ttest2e(x,y,''test'') | ||
===Description=== | ===Description=== | ||
Calculates a two sample paired t-test for samples (x) and (y). | Calculates a two sample paired t-test for samples (x) and (y). | ||
====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) | ||
====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 | ||
* '''mean''' = mean of x - y | * '''mean''' = mean of x - y | ||
* '''var''' = variance of x - y | * '''var''' = variance of x - y | ||
* '''n''' = length of x - y | * '''n''' = length of x - y | ||
* '''se''' = standard error | * '''se''' = standard error | ||
* '''df''' = degress of freedom | * '''df''' = degress of freedom | ||
* '''hyp''' = hypothesis being tested | * '''hyp''' = hypothesis being tested | ||
===Examples=== | ===Examples=== | ||
result = ttest2p(x,y); | result = ttest2p(x,y); | ||
result = ttest2p(x,y,test); | result = ttest2p(x,y,test); | ||
===See Also=== | ===See Also=== | ||
[[ttest1]], [[ttest2e]], [[ttest2u]] | [[ttest1]], [[ttest2e]], [[ttest2u]] |
Revision as of 14:27, 3 September 2008
Purpose
Two sample paired t-test.
Synopsis
- result = ttest2e(x,y,test)
Description
Calculates a two sample paired t-test for samples (x) and (y).
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
- mean = mean of x - y
- var = variance of x - y
- n = length of x - y
- se = standard error
- df = degress of freedom
- hyp = hypothesis being tested
Examples
result = ttest2p(x,y);
result = ttest2p(x,y,test);