Statistics
ChiSquareIndependenceTest
apply the chi-square test for independence in a matrix
Calling Sequence
Parameters
Description
Options
Notes
Examples
References
Compatibility
ChiSquareIndependenceTest(X, options)
X
-
Matrix of categorized data
options
(optional) equation(s) of the form option=value where option is one of level, output, or summarize; specify options for the ChiSquareIndependenceTest function
The ChiSquareIndependenceTest function computes the chi-square test for independence in a matrix. This test attempts to determine if two factors can be considered to be independent of one another for purposes of analysis.
The first parameter X is a matrix of categorized data samples.
The options argument can contain one or more of the options shown below.
level=float
This option is used to specify the level of the analysis (minimum criteria for a data set to be considered independent). By default this value is 0.05.
output='report', 'statistic', 'pvalue', 'criticalvalue', 'distribution', 'hypothesis', or list('statistic', 'pvalue', 'criticalvalue', 'distribution', 'hypothesis')
This option is used to specify the desired format of the output from the function. If 'report' is specified then a module containing all output from this test is returned. If a single parameter name is specified other than 'report' then that quantity alone is returned. If a list of parameter names is specified then a list containing those quantities in the specified order will be returned.
summarize= 'true', 'false', 'embed'
This option controls the display of a printed or embedded summary for the hypothesis test. Unlike the output option, the displayed summary is not assignable output.
This test generates a complete report of all calculations in the form of a userinfo message. In order to access this report, specify infolevel[Statistics] := 1 or use the summarize option.
with⁡Statistics:
Specify the matrices of categorized data values.
X≔Matrix⁡32,12,14,22,6,9:
Y≔Matrix⁡2,4,4,9,7,12:
Perform the independence test on the first sample.
ChiSquareIndependenceTest⁡X,level=0.05,summarize=embed:
Null Hypothesis:
Two attributes within a population are independent of one another
Alternative Hypothesis:
Two attributes within a population are not independent of one another
Dimensions
Total Elements
Distribution
Computed Statistic
Computed p-value
Critical Value
3.
95.
ChiSquare⁡2
10.7122
0.00471928
5.99146
Result:
Rejected: This statistical test provides evidence that the null hypothesis is false.
Perform the independence test on the second sample.
ChiSquareIndependenceTest⁡Y,level=0.05,summarize=true
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.
hypothesis=true,criticalvalue=5.99146454710798,distribution=ChiSquare⁡2,pvalue=0.937575872647938,statistic=0.1289151874
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.
The Statistics[ChiSquareIndependenceTest] command was updated in Maple 2016.
The summarize option was introduced in Maple 2016.
For more information on Maple 2016 changes, see Updates in Maple 2016.
See Also
Statistics[Computation]
Download Help Document