Ttest1: Difference between revisions
Jump to navigation
Jump to search
imported>Jeremy (Importing text file) |
imported>Jeremy (Importing text file) |
||
Line 5: | Line 5: | ||
===Description=== | ===Description=== | ||
Calculates a one sample t-test for sample (x). | Calculates a one sample t-test for sample (x). | ||
INPUTS | ====INPUTS==== | ||
* x = The name of a matrix (column vector) in which the sample data is stored. | * '''x''' = The name of a matrix (column vector) in which the sample data is stored. | ||
* mu = scalar, the null hypthesis value for the mean {default = 0}. | * '''mu''' = scalar, the null hypthesis value for the mean {default = 0}. | ||
* 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 | * '''mean''' = mean of x | ||
* var = variance of x | * '''var''' = variance of x | ||
* n = length of x | * '''n''' = length of x | ||
* 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 = ttest1(x); | result = ttest1(x); |
Revision as of 19:58, 2 September 2008
Purpose
One sample t-test.
Synopsis
- result = ttest1(x,mu,test)
Description
Calculates a one sample t-test for sample (x).
INPUTS
- x = The name of a matrix (column vector) in which the sample data is stored.
- mu = scalar, the null hypthesis value for the mean {default = 0}.
- 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
- var = variance of x
- n = length of x
- se = standard error
- df = degress of freedom
- hyp = hypothesis being tested
Examples
result = ttest1(x); result = ttest1(x,mu); result = ttest1(x,mu,test);