<?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%3AZ_Test</id>
	<title>TI-BASIC:Z 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%3AZ_Test"/>
	<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=TI-BASIC:Z_Test&amp;action=history"/>
	<updated>2026-05-15T14:52:19Z</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:Z_Test&amp;diff=615&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:Z_Test&amp;diff=615&amp;oldid=prev"/>
		<updated>2016-02-24T18:10:02Z</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=ZTEST.GIF&lt;br /&gt;
|summary=Performs a &amp;#039;&amp;#039;z&amp;#039;&amp;#039; significance test.&lt;br /&gt;
|syntax=Z-Test(&amp;#039;&amp;#039;μ,,0,,&amp;#039;&amp;#039;, &amp;#039;&amp;#039;σ&amp;#039;&amp;#039;, [&amp;#039;&amp;#039;list&amp;#039;&amp;#039;, &amp;#039;&amp;#039;frequency&amp;#039;&amp;#039;, &amp;#039;&amp;#039;alternative&amp;#039;&amp;#039;, &amp;#039;&amp;#039;draw?&amp;#039;&amp;#039;]&lt;br /&gt;
(data list input)&lt;br /&gt;
&lt;br /&gt;
Z-Test(&amp;#039;&amp;#039;μ,,0,,&amp;#039;&amp;#039;, &amp;#039;&amp;#039;σ&amp;#039;&amp;#039;, &amp;#039;&amp;#039;sample mean&amp;#039;&amp;#039;, &amp;#039;&amp;#039;sample size&amp;#039;&amp;#039;, [&amp;#039;&amp;#039;alternative&amp;#039;&amp;#039;, &amp;#039;&amp;#039;draw?&amp;#039;&amp;#039;]&lt;br /&gt;
(summary stats input)&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;
# ENTER to select Z-Test(&lt;br /&gt;
(outside the program editor, this will select the Z-Test... interactive solver)&lt;br /&gt;
|compatibility=TI-83/84/+/SE&lt;br /&gt;
|size=2 bytes&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Z-Test( performs a &amp;#039;&amp;#039;z&amp;#039;&amp;#039; significance test of a null hypothesis you supply. This test is valid for simple random samples from a population with a known standard deviation. In addition, either the population must be normally distributed, or the sample size has to be sufficiently large.&lt;br /&gt;
&lt;br /&gt;
The logic behind a Z-Test is as follows: we want to test the hypothesis that the true mean of a population is a certain value (&amp;#039;&amp;#039;μ,,0,,&amp;#039;&amp;#039;). To do this, we assume that this &amp;quot;null hypothesis&amp;quot; is true, and calculate the probability that the variation from this mean occurred, under this assumption. If this probability is sufficiently low (usually, 5% is the cutoff point), we conclude that since it&amp;#039;s so unlikely that the data could have occurred under the null hypothesis, the null hypothesis must be false, and therefore the true mean &amp;#039;&amp;#039;μ&amp;#039;&amp;#039; is not equal to &amp;#039;&amp;#039;μ,,0,,&amp;#039;&amp;#039;. If, on the other hand, the probability is not too low, we conclude that the data may well have occurred under the null hypothesis, and therefore there&amp;#039;s no reason to reject it.&lt;br /&gt;
&lt;br /&gt;
In addition to the null hypothesis, we must have an alternative hypothesis as well - usually this is simply that the true mean is &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;μ,,0,,&amp;#039;&amp;#039;. However, in certain cases when we have reason to suspect the true mean is less than or greater than &amp;#039;&amp;#039;μ,,0,,&amp;#039;&amp;#039;, we might use a &amp;quot;one-sided&amp;quot; alternative hypothesis, which will state that the true mean &amp;#039;&amp;#039;μ&amp;#039;&amp;#039;&amp;lt;&amp;#039;&amp;#039;μ,,0,,&amp;#039;&amp;#039; or that &amp;#039;&amp;#039;μ&amp;#039;&amp;#039;&amp;gt;&amp;#039;&amp;#039;μ,,0,,&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
As for the Z-Test( command itself, there are two ways of calling it: you may give it a list of all the sample data, or the necessary statistics about the list - its size, and the mean. In either case, you can indicate what the alternate hypothesis is, by a value of 0, -1, or 1 for the &amp;#039;&amp;#039;alternative&amp;#039;&amp;#039; argument. 0 indicates a two-sided hypothesis of &amp;#039;&amp;#039;μ&amp;#039;&amp;#039;≠&amp;#039;&amp;#039;μ,,0,,&amp;#039;&amp;#039;, -1 indicates &amp;#039;&amp;#039;μ&amp;#039;&amp;#039;&amp;lt;&amp;#039;&amp;#039;μ,,0,,&amp;#039;&amp;#039;, and 1 indicates &amp;#039;&amp;#039;μ&amp;#039;&amp;#039;&amp;gt;&amp;#039;&amp;#039;μ,,0,,&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Although you can access the Z-Test( command on the home screen, via the catalog, there&amp;#039;s no need: the Z-Test... interactive solver, found in the statistics menu, is much more intuitive to use - you don&amp;#039;t have to memorize the syntax.&lt;br /&gt;
&lt;br /&gt;
In either case, it&amp;#039;s important to understand the output of Z-Test. Here are the meanings of each line:&lt;br /&gt;
&lt;br /&gt;
* The first line, involving μ, is the alternative hypothesis.&lt;br /&gt;
* z is the test statistic, the standardized difference between the sample mean and &amp;#039;&amp;#039;μ,,0,,&amp;#039;&amp;#039;. If the null hypothesis is true, it should be close to 0.&lt;br /&gt;
* p is the probability that the difference between the sample mean and &amp;#039;&amp;#039;μ,,0,,&amp;#039;&amp;#039; would occur if the null hypothesis is true. When the value is sufficiently small, we reject the null hypothesis and conclude that the alternative hypothesis is true. You should have a cutoff value ready, such as 5% or 1%. If p is lower, you &amp;quot;reject the null hypothesis on a 5% (or 1%) level&amp;quot; in technical terms.&lt;br /&gt;
* x-bar is the sample mean.&lt;br /&gt;
* Sx is the sample standard deviation. This isn&amp;#039;t actually used in any calculations, and will only be shown for data list input.&lt;br /&gt;
* n is the sample size.&lt;br /&gt;
&lt;br /&gt;
= Sample Problem =&lt;br /&gt;
&lt;br /&gt;
According to M&amp;amp;M&amp;#039;s advertising, each standard-size bag of M&amp;amp;M&amp;#039;s contains an average of 10 blue M&amp;amp;M&amp;#039;s with a standard deviation of 2 M&amp;amp;M&amp;#039;s. You think that this estimate is low, and that the true average is higher. You decide to test this hypothesis by buying thirty bags of M&amp;amp;M&amp;#039;s. You count the number of blue M&amp;amp;M&amp;#039;s in each, and store this number to L1.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;#039;&amp;#039;μ,,0,,&amp;#039;&amp;#039; is 10, because you want to test the null hypothesis that there are on average 10 blue M&amp;amp;M&amp;#039;s per bag. The value of &amp;#039;&amp;#039;σ&amp;#039;&amp;#039; is 2. We want to test the values in L1. Because we want to test if there&amp;#039;s actually more than 10 blue M&amp;amp;M&amp;#039;s per bag, we have a one-sided alternate hypothesis: &amp;#039;&amp;#039;μ&amp;#039;&amp;#039;&amp;gt;&amp;#039;&amp;#039;μ,,0,,&amp;#039;&amp;#039;, which corresponds to an argument of 1. To solve the problem, you&amp;#039;d use this code:&lt;br /&gt;
&lt;br /&gt;
 :Z-Test(10,2,L1,1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Alternatively, you could calculate the mean and sample size of your sample, and put those into the command instead. The sample size is 30; let&amp;#039;s suppose that the mean was 11.2. The code you&amp;#039;d use is:&lt;br /&gt;
&lt;br /&gt;
 :Z-Test(10,2,11.2,30,1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will see the following output:&lt;br /&gt;
&lt;br /&gt;
 Z-Test&lt;br /&gt;
  μ&amp;gt;10&lt;br /&gt;
  z=3.286335345&lt;br /&gt;
  p=5.0755973e-4&lt;br /&gt;
  x=11.2&lt;br /&gt;
  n=30&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The most important part of this output is &amp;quot;p=5.0755973e-4&amp;quot;. This value of p is much smaller than 1% or 0.01; it&amp;#039;s in fact around 0.0005. This is significant on the 1% level, so we reject the null hypothesis and conclude that the alternative hypothesis is true: μ&amp;gt;10, that is, the average number of blue M&amp;amp;M&amp;#039;s in a bag is more than 10.&lt;br /&gt;
&lt;br /&gt;
= Advanced Uses =&lt;br /&gt;
&lt;br /&gt;
The final argument of Z-Test(, &amp;#039;&amp;#039;draw?&amp;#039;&amp;#039;, will display the results in a graphical manner if you put in &amp;quot;1&amp;quot; for it. The calculator will draw the &amp;#039;&amp;#039;&amp;#039;standard&amp;#039;&amp;#039;&amp;#039; normal curve, and shade the area of the graph beyound the z statistic. In addition, the value of z and the value of p will be displayed (the value of p corresponds to the shaded area). You would make your conclusions in the same way as for the regular output.&lt;br /&gt;
&lt;br /&gt;
As with most other statistical commands, you may use a frequency list in your input (when using the data list syntax).&lt;br /&gt;
&lt;br /&gt;
= Optimization =&lt;br /&gt;
&lt;br /&gt;
Most of the arguments of the Z-Test( command have default values, and the argument can be omitted if this value is accepted.&lt;br /&gt;
&lt;br /&gt;
* The &amp;#039;&amp;#039;draw?&amp;#039;&amp;#039; argument can be omitted if you don&amp;#039;t want graphical output, although you could put &amp;quot;0&amp;quot; in as well.&lt;br /&gt;
* If the &amp;#039;&amp;#039;draw?&amp;#039;&amp;#039; argument is omitted, you can omit the &amp;#039;&amp;#039;alternative&amp;#039;&amp;#039; argument to use a two-sided test (&amp;#039;&amp;#039;μ&amp;#039;&amp;#039;≠&amp;#039;&amp;#039;μ,,0,,&amp;#039;&amp;#039;). If you include the &amp;#039;&amp;#039;draw?&amp;#039;&amp;#039; argument, you have to include this - otherwise there will be confusion as to what the 5th argument means.&lt;br /&gt;
* With data list input, you can always omit the frequency list if you won&amp;#039;t be using it.&lt;br /&gt;
* With data list input, if the &amp;#039;&amp;#039;draw?&amp;#039;&amp;#039; and &amp;#039;&amp;#039;alternative&amp;#039;&amp;#039; arguments are omitted, and your data is in L1, you may omit L1 as well. However, if &amp;#039;&amp;#039;alternative&amp;#039;&amp;#039; or &amp;#039;&amp;#039;draw?&amp;#039;&amp;#039; is present, you have to include it, or else the syntax may be confused with the syntax for summary stats input.&lt;br /&gt;
&lt;br /&gt;
The code in the sample problem above can&amp;#039;t be optimized, because the &amp;#039;&amp;#039;alternative&amp;#039;&amp;#039; argument is 1:&lt;br /&gt;
&lt;br /&gt;
 ::Z-Test(10,2,L1,1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, if we were doing a two-sided test, we could omit the &amp;#039;&amp;#039;alternative&amp;#039;&amp;#039; and the &amp;#039;&amp;#039;list&amp;#039;&amp;#039; arguments (since we&amp;#039;re testing L1):&lt;br /&gt;
&lt;br /&gt;
 :Z-Test(10,2,L1,0&lt;br /&gt;
 can be&lt;br /&gt;
 :Z-Test(10,2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Related Commands =&lt;br /&gt;
&lt;br /&gt;
* [[TI-BASIC:2_Sampztest|2_SampZTest(]]&lt;br /&gt;
* [[TI-BASIC:T_Test|T_Test]]&lt;br /&gt;
* [[TI-BASIC:2_Sampttest|2_SampTTest]][[Category:TI-BASIC]]&lt;br /&gt;
[[Category:TIBD]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>