FUNCTION REFERENCE

ttest2

Independent two-sample Student or Welch t-test.

Independent two-sample Student or Welch t-test.

Syntax

[h,p,ci,stats] = ttest2(x,y[,'Vartype','equal','Alpha',a,'Tail',tail,'Dim',dim])

Vartype equal uses the pooled standard deviation; unequal uses Welch-Satterthwaite degrees of freedom and returns both sample standard deviations along the test dimension. NaNs are removed separately in each sample. Two vectors are one test regardless of orientation; otherwise unreduced dimensions must agree. Tail is both, left or right; Alpha defaults to 0.05. Legacy positional alpha, tail, vartype and dim are accepted.

Example

[h,p,ci,s] = ttest2([1 2 4],[2 5 9],'Vartype','unequal')

Differences from MATLAB: real 2-D numeric/logical inputs; integer and single inputs produce double results.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.