Home > freetb4matlab > statistics > tests > prop_test_2.m

# prop_test_2

## PURPOSE

% If @var{x1} and @var{n1} are the counts of successes and trials in

## SYNOPSIS

function [pval, z] = prop_test_2 (x1, n1, x2, n2, alt)

## DESCRIPTION

```% -*- texinfo -*-
% @deftypefn {Function File} {[@var{pval}, @var{z}] =} prop_test_2 (@var{x1}, @var{n1}, @var{x2}, @var{n2}, @var{alt})
% If @var{x1} and @var{n1} are the counts of successes and trials in
% one sample, and @var{x2} and @var{n2} those in a second one, test the
% null hypothesis that the success probabilities @var{p1} and @var{p2}
% are the same.  Under the null, the test statistic @var{z}
% approximately follows a standard normal distribution.
%
% 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
% @var{p1} ~= @var{p2}.  If @var{alt} is @code{'>'}, the one-sided
% alternative @var{p1} > @var{p2} is used.  Similarly for @code{'<'},
% the one-sided alternative @var{p1} < @var{p2} 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