Student[Statistics] - Maple Programming Help

Home : Support : Online Help : Education : Student Package : Statistics : Hypothesis Tests : Student/Statistics/ChiSquareIndependenceTest

Student[Statistics]

 ChiSquareIndependenceTest
 apply the chi-square test for independence in a matrix

 Calling Sequence ChiSquareIndependenceTest(X, level_option)

Parameters

 X - Matrix of categorized data level_option - (optional) equation of the form level=float.

Description

 • The ChiSquareIndependenceTest function computes the chi-square test for independence in a Matrix. This tests whether two factors in a population are independent of one another. The rows represent the levels of one factor; the columns represent the levels of another. The entries in the Matrix are interpreted as counts of observations with the given combination of levels.
 • The first parameter X is a Matrix of categorized data samples.
 • level=float
 This option is used to specify the level of analysis (minimum criteria for the observed data to be considered well-fit to the expected data). By default, this value is 0.05.

Examples

 > $\mathrm{with}\left(\mathrm{Student}[\mathrm{Statistics}]\right):$

Specify the matrices of categorized data values.

 > $X≔\mathrm{Matrix}\left(\left[\left[32,12\right],\left[14,22\right],\left[6,9\right]\right]\right):$
 > $Y≔\mathrm{Matrix}\left(\left[\left[2,4\right],\left[4,9\right],\left[7,12\right]\right]\right):$

Perform the independence test on the first sample.

 > $\mathrm{ChiSquareIndependenceTest}\left(X,\mathrm{level}=0.05\right)$
 Chi-Square Test for Independence -------------------------------- Null Hypothesis: Two attributes within a population are independent of one another Alt. Hypothesis: Two attributes within a population are not independent of one another   Dimensions:              3 Total Elements:          95 Distribution:            ChiSquare(2) Computed Statistic:      10.71219801 Computed p-value:        .00471928013704082 Critical Values:         5.99146454710798   Result: [Rejected] This statistical test provides evidence that the null hypothesis is false.
 ${\mathrm{hypothesis}}{=}{\mathrm{false}}{,}{\mathrm{criticalvalue}}{=}{5.99146454710798}{,}{\mathrm{distribution}}{=}{\mathrm{ChiSquare}}{}\left({2}\right){,}{\mathrm{pvalue}}{=}{0.00471928013704082}{,}{\mathrm{statistic}}{=}{10.71219801}$ (1)

Perform the independence test on the second sample.

 > $\mathrm{ChiSquareIndependenceTest}\left(Y,\mathrm{level}=0.05\right)$
 Chi-Square Test for Independence -------------------------------- Null Hypothesis: Two attributes within a population are independent of one another Alt. Hypothesis: Two attributes within a population are not independent of one another   Dimensions:              3 Total Elements:          38 Distribution:            ChiSquare(2) Computed Statistic:      .1289151874 Computed p-value:        .937575872647938 Critical Values:         5.99146454710798   Result: [Accepted] This statistical test does not provide enough evidence to conclude that the null hypothesis is false.
 ${\mathrm{hypothesis}}{=}{\mathrm{true}}{,}{\mathrm{criticalvalue}}{=}{5.99146454710798}{,}{\mathrm{distribution}}{=}{\mathrm{ChiSquare}}{}\left({2}\right){,}{\mathrm{pvalue}}{=}{0.937575872647938}{,}{\mathrm{statistic}}{=}{0.1289151874}$ (2)

References

 Kanju, Gopal K. 100 Statistical Tests. London: SAGE Publications Ltd., 1994.
 Sheskin, David J. Handbook of Parametric and Nonparametric Statistical Procedures. London: CRC Press, 1997.

Compatibility

 • The Student[Statistics][ChiSquareIndependenceTest] command was introduced in Maple 18.