Home > freetb4matlab > statistics > tests > t_test_2.m

# t_test_2

## PURPOSE

% For two samples x and y from normal distributions with unknown means

## SYNOPSIS

function [pval, t, df] = t_test_2 (x, y, alt)

## DESCRIPTION

```% -*- texinfo -*-
% @deftypefn {Function File} {[@var{pval}, @var{t}, @var{df}] =} t_test_2 (@var{x}, @var{y}, @var{alt})
% For two samples x and y from normal distributions with unknown means
% and unknown equal variances, perform a two-sample t-test of the null
% hypothesis of equal means.  Under the null, the test statistic
% @var{t} follows a Student distribution with @var{df} degrees of
% freedom.
%
% With the optional argument string @var{alt}, the alternative of
% interest can be selected.  If @var{alt} is @code{'~='} or
% @code{'<>'}, the null is tested against the two-sided alternative
% @code{mean (@var{x}) ~= mean (@var{y})}.  If @var{alt} is @code{'>'},
% the one-sided alternative @code{mean (@var{x}) > mean (@var{y})} is
% used.  Similarly for @code{'<'}, the one-sided alternative @code{mean
% (@var{x}) < mean (@var{y})} is used.  The default is the two-sided
% case.
%
% The p-value of the test is returned in @var{pval}.
%
% If no output argument is given, the p-value of the test is displayed.
% @end deftypefn```

## CROSS-REFERENCE INFORMATION

This function calls:
This function is called by:

Generated on Sat 16-May-2009 00:04:49 by m2html © 2003