Difference between revisions of "ChiSquaredTest Command"

From GeoGebra Manual
Jump to: navigation, search
(command syntax: changed [ ] into ( ))
m (;ChiSquaredTest( <Observed Matrix>, <Expected Matrix> ))
 
Line 6: Line 6:
 
:Results are returned in list form as ''{Probabilty value, chi-squared test statistic}''.
 
:Results are returned in list form as ''{Probabilty value, chi-squared test statistic}''.
 
:{{example|1=<code><nowiki>ChiSquaredTest({{1, 2, 1}, {3, 2, 3}})</nowiki></code> yields ''{0.69, 0.75}''.}}
 
:{{example|1=<code><nowiki>ChiSquaredTest({{1, 2, 1}, {3, 2, 3}})</nowiki></code> yields ''{0.69, 0.75}''.}}
;ChiSquaredTest( <List>, <List> )
+
;ChiSquaredTest( <Observed List>, <Expected List> )
 
:Performs a [[w:Goodness of fit|Goodness of Fit test]] that compares the given list of observed counts against the given list of expected counts.   
 
:Performs a [[w:Goodness of fit|Goodness of Fit test]] that compares the given list of observed counts against the given list of expected counts.   
 
:Results are returned in list form as ''{Probabilty value, chi-squared test statistic}''.
 
:Results are returned in list form as ''{Probabilty value, chi-squared test statistic}''.
 
:{{example|1=<code><nowiki>ChiSquaredTest({1, 2, 3, 4}, {3, 2, 4, 2})</nowiki></code> yields ''{0.31, 3.58}''.}}
 
:{{example|1=<code><nowiki>ChiSquaredTest({1, 2, 3, 4}, {3, 2, 4, 2})</nowiki></code> yields ''{0.31, 3.58}''.}}
;ChiSquaredTest( <Matrix>, <Matrix> )
+
;ChiSquaredTest( <Observed Matrix>, <Expected Matrix> )
 
:Performs a [[w:Chi-squared_test|chi-squared test]] that compares the given matrix of observed counts against the given matrix of expected counts.   
 
:Performs a [[w:Chi-squared_test|chi-squared test]] that compares the given matrix of observed counts against the given matrix of expected counts.   
 
:Results are returned in list form as ''{Probabilty value, chi-squared test statistic}''.
 
:Results are returned in list form as ''{Probabilty value, chi-squared test statistic}''.
 
:{{example|1=<code><nowiki>ChiSquaredTest({{1, 2, 1}, {3, 2, 3}}, {{2, 3, 2}, {4, 2, 3}})</nowiki></code> yields ''{0.45, 1.58}''.}}
 
:{{example|1=<code><nowiki>ChiSquaredTest({{1, 2, 1}, {3, 2, 3}}, {{2, 3, 2}, {4, 2, 3}})</nowiki></code> yields ''{0.45, 1.58}''.}}

Latest revision as of 23:14, 15 December 2019


ChiSquaredTest( <Matrix> )
Performs a chi-squared test that compares the given matrix of observed counts against the matrix of expected counts determined by the hypothesis of independence.
The matrix of expected counts is calculated internally. Each expected count is found from the row and column totals of the given matrix of observed counts using the rule:
\text{expected count} = \frac{\text{row total} × \text{column total}}{\text{total observed counts}}
Results are returned in list form as {Probabilty value, chi-squared test statistic}.
Example: ChiSquaredTest({{1, 2, 1}, {3, 2, 3}}) yields {0.69, 0.75}.
ChiSquaredTest( <Observed List>, <Expected List> )
Performs a Goodness of Fit test that compares the given list of observed counts against the given list of expected counts.
Results are returned in list form as {Probabilty value, chi-squared test statistic}.
Example: ChiSquaredTest({1, 2, 3, 4}, {3, 2, 4, 2}) yields {0.31, 3.58}.
ChiSquaredTest( <Observed Matrix>, <Expected Matrix> )
Performs a chi-squared test that compares the given matrix of observed counts against the given matrix of expected counts.
Results are returned in list form as {Probabilty value, chi-squared test statistic}.
Example: ChiSquaredTest({{1, 2, 1}, {3, 2, 3}}, {{2, 3, 2}, {4, 2, 3}}) yields {0.45, 1.58}.
© 2024 International GeoGebra Institute