<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://learn.cemetech.net/index.php?action=history&amp;feed=atom&amp;title=TI-BASIC%3AChisquaregof_Test</id>
	<title>TI-BASIC:Chisquaregof Test - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://learn.cemetech.net/index.php?action=history&amp;feed=atom&amp;title=TI-BASIC%3AChisquaregof_Test"/>
	<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=TI-BASIC:Chisquaregof_Test&amp;action=history"/>
	<updated>2026-05-30T16:57:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>http://learn.cemetech.net/index.php?title=TI-BASIC:Chisquaregof_Test&amp;diff=1457&amp;oldid=prev</id>
		<title>Maintenance script: Automated superscript correction</title>
		<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=TI-BASIC:Chisquaregof_Test&amp;diff=1457&amp;oldid=prev"/>
		<updated>2016-02-24T22:24:30Z</updated>

		<summary type="html">&lt;p&gt;Automated superscript correction&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:24, 24 February 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l40&quot;&gt;Line 40:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 40:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Formulas =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Formulas =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The formula for calculating the test statistic is as follows (O,,i,, is the observed count of the i&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;^^&lt;/del&gt;th&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;^^ &lt;/del&gt;category, and E,,i,, is the expected count):&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The formula for calculating the test statistic is as follows (O,,i,, is the observed count of the i&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;sup&amp;gt;&lt;/ins&gt;th&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/sup&amp;gt; &lt;/ins&gt;category, and E,,i,, is the expected count):&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Template:TI-BASIC:Math eqn=\chi_{n-1}^2 = \sum_{i=1}^n \frac{(O_i-E_i)^2}{E_i}}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Template:TI-BASIC:Math eqn=\chi_{n-1}^2 = \sum_{i=1}^n \frac{(O_i-E_i)^2}{E_i}}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
	<entry>
		<id>http://learn.cemetech.net/index.php?title=TI-BASIC:Chisquaregof_Test&amp;diff=918&amp;oldid=prev</id>
		<title>Maintenance script: Initial automated import</title>
		<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=TI-BASIC:Chisquaregof_Test&amp;diff=918&amp;oldid=prev"/>
		<updated>2016-02-24T18:25:18Z</updated>

		<summary type="html">&lt;p&gt;Initial automated import&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Template:TI-BASIC:Command&lt;br /&gt;
|picture=@@CHISQUAREGOFTEST.GIF&lt;br /&gt;
|summary=Performs a χ² goodness-of-fit test.&lt;br /&gt;
|syntax=χ²GOF-Test(&amp;#039;&amp;#039;observed&amp;#039;&amp;#039;,&amp;#039;&amp;#039;expected&amp;#039;&amp;#039;,&amp;#039;&amp;#039;df&amp;#039;&amp;#039;)&lt;br /&gt;
|location=While editing a program, press:&lt;br /&gt;
# STAT to access the statistics menu.&lt;br /&gt;
# LEFT to access the tests submenu.&lt;br /&gt;
# ALPHA D to select χ²GOF-Test(.&lt;br /&gt;
(outside the program editor, this will select the χ²GOF-Test… interactive solver)&lt;br /&gt;
|compatibility=TI-84+/SE, OS 2.30 or higher&lt;br /&gt;
|size=2 bytes&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The χ²GOF-Test( command performs a χ² goodness-of-fit test. Given an expected ideal distribution of a variable across several categories, and a sample from this variable, it tests the hypothesis that the variable actually fits the ideal distribution. As a special case, you could take the ideal distribution to be evenly divided across all categories. Then, the goodness-of-fit test will test the hypothesis that the variable is independent of the category.&lt;br /&gt;
&lt;br /&gt;
The command takes three arguments:&lt;br /&gt;
* An &amp;#039;&amp;#039;observed&amp;#039;&amp;#039; list with an element for each category: the element records the number of times this category appeared in the sample.&lt;br /&gt;
* An &amp;#039;&amp;#039;expected&amp;#039;&amp;#039; list with an element for each category: the element records the frequency with which the category was expected to appear.&lt;br /&gt;
* The &amp;#039;&amp;#039;degrees of freedom&amp;#039;&amp;#039; -- usually taken to be one less than the number of categories.&lt;br /&gt;
&lt;br /&gt;
The output is two-fold: &lt;br /&gt;
* The test statistic, χ². If the null hypothesis (that the variable fits the distribution) is true, this should be close to 1.&lt;br /&gt;
* The probability, p, of the observed distribution assuming the null hypothesis. If this value is low (usually, if it&amp;#039;s lower than .05, or lower than .01) this is sufficient evidence to reject the null hypothesis, and conclude that the variable fits a different distribution.&lt;br /&gt;
&lt;br /&gt;
= Sample Problem =&lt;br /&gt;
&lt;br /&gt;
Working as a sales clerk, you&amp;#039;re wondering if the number of customers depends on the day of week. You&amp;#039;ve taken a count of the number of customers every day for a week: 17 on Monday, 21 on Tuesday, 18 on Wednesday, 10 on Thursday, 24 on Friday, 28 on Saturday, and 24 on Sunday. Store this observed count: {17,21,18,10,24,28,24} to L1.&lt;br /&gt;
&lt;br /&gt;
There were a total of sum(L1)=142 customers. So the expected number of customers on each day was 142/7. Store all the expected counts: {142/7,142/7,142/7,142/7,142/7,142/7,142/7} to L2 (as a shortcut, you can store 142/7{1,1,1,1,1,1,1}).&lt;br /&gt;
&lt;br /&gt;
Since there are 7 days, there are 6 (one less) degrees of freedom. So the resulting command is χ²GOF-Test(L1,L2,6).&lt;br /&gt;
&lt;br /&gt;
The output will give a χ² of 10.32394366, and a p value of 0.1116563376. This is higher than 5%, so the test is not significant on a 95 percent level. It&amp;#039;s perfectly possible, in other words, that the number of customers is independent of the day of week.&lt;br /&gt;
&lt;br /&gt;
(Note that in this case, if you suspected the number of customers to be higher on weekends, you could use a more sensitive test for only two categories: [[TI-BASIC:2_Sampttest|2_SampTTest]])&lt;br /&gt;
&lt;br /&gt;
= Advanced Uses =&lt;br /&gt;
&lt;br /&gt;
The χ²GOF-Test( command is only available on the TI-84 Plus and TI-84 Plus SE. However, it&amp;#039;s possible to use the [[TI-BASIC:Chisquarecdf|χ²cdf(]] command to simulate it on the other calculators: see the [[TI-BASIC:Goodness_Of_Fit|χ² Goodness-of-fit Test]] routine.&lt;br /&gt;
= Formulas =&lt;br /&gt;
&lt;br /&gt;
The formula for calculating the test statistic is as follows (O,,i,, is the observed count of the i^^th^^ category, and E,,i,, is the expected count):&lt;br /&gt;
&lt;br /&gt;
{{Template:TI-BASIC:Math eqn=\chi_{n-1}^2 = \sum_{i=1}^n \frac{(O_i-E_i)^2}{E_i}}}&lt;br /&gt;
&lt;br /&gt;
The p-value, then, is the probability that the χ² statistic would be this high, using the [[TI-BASIC:Chisquarecdf|χ²cdf(]] command with the appropriate value for degrees of freedom.&lt;br /&gt;
&lt;br /&gt;
= Error Conditions =&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[TI-BASIC:Errors#dimmismatch|ERR:DIM MISMATCH]]&amp;#039;&amp;#039;&amp;#039; is thrown if the two lists are of different length.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[TI-BASIC:Errors#domain|ERR:DOMAIN]]&amp;#039;&amp;#039;&amp;#039; is thrown if they only have one element, or if &amp;#039;&amp;#039;df&amp;#039;&amp;#039; is not a positive integer.&lt;br /&gt;
&lt;br /&gt;
= Related Commands =&lt;br /&gt;
&lt;br /&gt;
* [[TI-BASIC:Chisquare_Test|χ²-Test(]]&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[TI-BASIC:Goodness_Of_Fit|χ² Goodness-of-fit Test]][[Category:TI-BASIC]]&lt;br /&gt;
[[Category:TIBD]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>