Ttest1: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
 
imported>Jeremy
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
===Purpose===
===Purpose===
One sample t-test.
One sample t-test.
===Synopsis===
===Synopsis===
:result = ttest1(x,''mu'',''test'')
:result = ttest1(x,''mu'',''test'')
===Description===
===Description===
Calculates a one sample t-test for sample (x).
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.
====Inputs====
* mu = scalar, the null hypthesis value for the mean {default = 0}.
 
* ttest = [-1,{0},1] indicates what ttest is for:
* '''x''' = The name of a matrix (column vector) in which the sample data is stored.
*   -1 - lower tail  H0: mean(x) <= mean(y)
 
*   0 - wo-tail    H0: mean(x) \~= mean(y) {default}
* '''mu''' = scalar, the null hypthesis value for the mean {default = 0}.
*   1 - upper tail  H0: mean(x) >= mean(y)
 
OUTPUTS:
* '''ttest''' = [-1,{0},1] indicates what ttest is for:
::   '''-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)
 
====Outputs====
 
The output (result) a structure with the following fields:
The output (result) a structure with the following fields:
* t = test statistic.
 
* p = probability value
* '''t''' = test statistic.
* mean = mean of x
 
* var = variance of x  
* '''p''' = probability value
* n =  length of x  
 
* se = standard error
* '''mean''' = mean of x
* df = degress of freedom  
 
* hyp =  hypothesis being tested
* '''var''' = variance of x  
 
* '''n''' =  length of x  
 
* '''se''' = standard error
 
* '''df''' = degress of freedom  
 
* '''hyp''' =  hypothesis being tested
 
===Examples===
===Examples===
result = ttest1(x);
result = ttest1(x);
result = ttest1(x,mu);  
result = ttest1(x,mu);  
result = ttest1(x,mu,test);
result = ttest1(x,mu,test);
===See Also===
===See Also===
[[ttest2e]], [[ttest2u]], [[ttest2p]]
[[ttest2e]], [[ttest2u]], [[ttest2p]]

Latest revision as of 16:24, 1 July 2011

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 - two-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);

See Also

ttest2e, ttest2u, ttest2p