Home > freetb4matlab > statistics > tests > t_test.m

t_test

PURPOSE ^

% For a sample @var{x} from a normal distribution with unknown mean and

SYNOPSIS ^

function [pval, t, df] = t_test (x, m, alt)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} {[@var{pval}, @var{t}, @var{df}] =} t_test (@var{x}, @var{m}, @var{alt})
% For a sample @var{x} from a normal distribution with unknown mean and
% variance, perform a t-test of the null hypothesis @code{mean
% (@var{x}) == @var{m}}.  Under the null, the test statistic @var{t}
% follows a Student distribution with @code{@var{df} = length (@var{x})
% - 1} 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}) ~= @var{m}}.  If @var{alt} is @code{'>'}, the
% one-sided alternative @code{mean (@var{x}) > @var{m}} is considered.
% Similarly for @var{'<'}, the one-sided alternative @code{mean
% (@var{x}) < @var{m}} is considered.  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 Fri 22-May-2009 15:13:00 by m2html © 2003