<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Блог Анкара &#187; Comparing Many Means with ANOVA</title>
	<atom:link href="http://ankar.info/category/comparing-many-means-with-anova/feed/" rel="self" type="application/rss+xml" />
	<link>http://ankar.info</link>
	<description>Еби гусей, спасай Россию</description>
	<lastBuildDate>Wed, 08 Feb 2012 09:02:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Pairing Things Down with Multiple Comparisons</title>
		<link>http://ankar.info/2010/05/15/pairing-things-down-with-multiple-comparisons/</link>
		<comments>http://ankar.info/2010/05/15/pairing-things-down-with-multiple-comparisons/#comments</comments>
		<pubDate>Sat, 15 May 2010 18:30:15 +0000</pubDate>
		<dc:creator>Анкар</dc:creator>
				<category><![CDATA[Comparing Many Means with ANOVA]]></category>

		<guid isPermaLink="false">http://ankar.info/2010/05/15/pairing-things-down-with-multiple-comparisons/</guid>
		<description><![CDATA[In This Chapter ^ When and how to follow up ANOVA with multiple comparisons ^ Comparing two well-known multiple comparison procedures Ou&#8217;re comparing the means of not two, but K Independent populations, and you find out (using ANOVA — see Chapter 9) that you reject Ho: All the population means are equal, and you conclude [...]]]></description>
			<content:encoded><![CDATA[<sape_index><p><b><i>In This Chapter</i></b></p>
<p>^ When and how to follow up ANOVA with multiple comparisons ^ Comparing two well-known multiple comparison procedures</p>
<p>Ou&#8217;re comparing the means of not two, but <i>K </i>Independent populations, and you find out (using ANOVA — see Chapter 9) that you reject Ho: All the population means are equal, and you conclude Ha: At least two of the population means are different. Now you gotta know — which of those populations are different? Answering this question requires a follow-up procedure to ANOVA called <i>Multiple comparisons, </i>Which makes sense because you want to compare the multiple means you have and see which ones are different.</p>
<p>In this chapter, you figure out when you need to use a multiple comparison procedure. You see two of the most well-known multiple comparison procedures: Fisher&#8217;s LSD (least significant difference) and Tukey&#8217;s test. They can help you answer that burning question: So some of the means are different, but which ones are different?</p>
<p><b><i>Following Up after ANOVA</i></b></p>
<p>This section runs through the ANOVA procedure in the case where Ho is rejected and leads you to the next step: multiple comparisons.</p>
<p>Suppose you want to compare the average number of cell-phone minutes used per month for children and young adults, where the age groups are the following:</p>
<p><b><i>Y</i></b></p>
<p><i>V </i>Group 1: 19 years old and under Group 2: 20-39 years old</p>
<p>Group 3: Adult males 40-59 years old</p>
<p>Group 4: Adult females 60 years old and over</p>
<p>You collect data on a random sample of 10 people from each group (where no one knows anyone else to keep independence), and you record the number of minutes each person used their cell phone in one month. The first ten lines of a hypothetical data set are shown in Table 10-1.</p>
<p><b>Table 10-1 One Month&#8217;s Cell Phone Minutes for Four Age Groups</b></p>
<table class=msonormaltable border=1 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p><b><i>19 and Under</i></b></p>
</td>
<td>
<p><b><i>20-39</i></b></p>
</td>
<td>
<p><b><i>40-59</i></b></p>
</td>
<td>
<p><b><i>60 and Over</i></b></p>
</td>
</tr>
<tr>
<td>
<p><b><i>(Group 1)</i></b></p>
</td>
<td>
<p><b><i>(Group 2)</i></b></p>
</td>
<td>
<p><b><i>(Group 3)</i></b></p>
</td>
<td>
<p><b><i>(Group 4)</i></b></p>
</td>
</tr>
<tr>
<td>
<p>800</p>
</td>
<td>
<p>250</p>
</td>
<td>
<p>700</p>
</td>
<td>
<p>200</p>
</td>
</tr>
<tr>
<td>
<p>850</p>
</td>
<td>
<p>350</p>
</td>
<td>
<p>700</p>
</td>
<td>
<p>120</p>
</td>
</tr>
<tr>
<td>
<p>800</p>
</td>
<td>
<p>375</p>
</td>
<td>
<p>750</p>
</td>
<td>
<p>150</p>
</td>
</tr>
<tr>
<td>
<p>650</p>
</td>
<td>
<p>320</p>
</td>
<td>
<p>650</p>
</td>
<td>
<p>90</p>
</td>
</tr>
<tr>
<td>
<p>750</p>
</td>
<td>
<p>430</p>
</td>
<td>
<p>550</p>
</td>
<td>
<p>20</p>
</td>
</tr>
<tr>
<td>
<p>680</p>
</td>
<td>
<p>380</p>
</td>
<td>
<p>580</p>
</td>
<td>
<p>150</p>
</td>
</tr>
<tr>
<td>
<p>800</p>
</td>
<td>
<p>325</p>
</td>
<td>
<p>700</p>
</td>
<td>
<p>200</p>
</td>
</tr>
<tr>
<td>
<p>750</p>
</td>
<td>
<p>410</p>
</td>
<td>
<p>700</p>
</td>
<td>
<p>130</p>
</td>
</tr>
<tr>
<td>
<p>690</p>
</td>
<td>
<p>450</p>
</td>
<td>
<p>590</p>
</td>
<td>
<p>160</p>
</td>
</tr>
<tr>
<td>
<p>710</p>
</td>
<td>
<p>390</p>
</td>
<td>
<p>650</p>
</td>
<td>
<p>30</p>
</td>
</tr>
</table>
<p>The means and standard deviations of the sample data are shown in Figure 10-1, as well as confidence intervals for each of the population means separately (see Chapter 3 for info on confidence intervals). Looking at Figure 10-1, it appears that all four means are different, with 19 and under heading the pack, with 40- to 59-year-olds not far behind, and with 20- to 39-year-olds and those over 60 bringing up the rear (in that order).</p>
<p>Knowing that man can&#8217;t live by sample results alone, you decide that ANOVA is needed to see whether any differences that appear in the samples can be extended to the population (see Chapter 9). By using the ANOVA procedure, you test whether the average cell minutes used is the same across all groups. The results of the ANOVA, using the data from Table 10-1, are shown in Figure 10-2.</p>
<p><b>Figure 10-1:</b></p>
<p>Basic statistics and</p>
<p>Confidence intervals for the cellphone data.</p>
<p>Individual 95% CIs For Mean Based on Pooled StDev</p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>Level</p>
</td>
<td>
<p>N</p>
</td>
<td>
<p>Mean</p>
</td>
<td>
<p>StDev</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>1</p>
</td>
<td>
<p>10</p>
</td>
<td>
<p>7 48.00</p>
</td>
<td>
<p>64.60</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>10</p>
</td>
<td>
<p>3 6 8.00</p>
</td>
<td>
<p>59.08</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>3</p>
</td>
<td>
<p>10</p>
</td>
<td>
<p>6 5 7.00</p>
</td>
<td>
<p>64.99</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>4</p>
</td>
<td>
<p>10</p>
</td>
<td>
<p>125.00</p>
</td>
<td>
<p>62.41</p>
</td>
</tr>
</table>
<p>&#8212;&#8212;-1&#8212;&#8212;&#8212;&#8211;1&#8212;&#8212;&#8212;&#8211;1&#8212;&#8212;&#8212;&#8211;1&#8212;-</p>
<p>(-*-)</p>
<p>(-*-)</p>
<p>(-*-)</p>
<p>(-*-)</p>
<p>&#8212;&#8212;-1&#8212;&#8212;&#8212;&#8211;1&#8212;&#8212;&#8212;&#8211;1&#8212;&#8212;&#8212;&#8211;1&#8212;-</p>
<p>200&nbsp;400&nbsp;600 800</p>
<p>Looking at Figure 10-2, the F-test for equality of all four population means has a p-value of 0.000, meaning it is less then 0.001. That says at least two of these groups have a significant difference in their cell-phone use (see Chapter 9 for info on the F-test and its results).</p>
<p><b>Figure 10-2:</b></p>
<p>ANOVA results for comparing cell-phone use for four age groups.</p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p><b>One-way ANOVA: Group 1, Group 2, Group 3, Group 4</b></p>
</td>
</tr>
<tr>
<td>
<p>Source</p>
</td>
<td>
<p>DF</p>
</td>
<td>
<p>SS</p>
</td>
<td>
<p>MS F P</p>
</td>
</tr>
<tr>
<td>
<p>Factor</p>
</td>
<td>
<p>3</p>
</td>
<td>
<p>2 416 010</p>
</td>
<td>
<p>805337 204.13 0.000</p>
</td>
</tr>
<tr>
<td>
<p>Error</p>
</td>
<td>
<p>36</p>
</td>
<td>
<p>142030</p>
</td>
<td>
<p>3945</p>
</td>
</tr>
<tr>
<td>
<p>Total</p>
</td>
<td>
<p>39</p>
</td>
<td>
<p>2558040</p>
</td>
</tr>
<tr>
<td>
<p>S = 6 2.81</p>
</td>
<td>
<p>R-Sq = 94.5%</p>
</td>
<td>
<p>R-Sq(adj) = 93.99%</p>
</td>
</tr>
</table>
<p>Okay, so what&#8217;s your next question? You just found out that the average number of cell-phone minutes per month isn&#8217;t the same across these four groups. Remember, this doesn&#8217;t mean all four groups are different (see Chapter 9). However, it does mean that at least two groups are significantly different in their cell-phone use. So your questions are: Which groups are different, and how are they different?</p>
<p>Determining which populations have differing means after ANOVA has been rejected involves a new data-analysis technique called <i>Multiple comparisons. </i>While many different multiple comparison procedures are out there, statisticians have their favorites, which I present in the next section.</p>
<p>Don&#8217;t attempt to explore the data with a multiple comparison procedure if the test for equality of the populations isn&#8217;t rejected. In this case, you must conclude that you don&#8217;t have enough evidence to say the population means aren&#8217;t equal, so you must stop there. Always look at the <i>P</i>-value of the <i>F</i>-test on the ANOVA output before moving on to conduct any multiple comparisons.</p>
<p><b><i>P</i></b><i>In</i><b><i>Po</i></b><i>Intin</i><b><i>G Diffe</i></b><i>Rin</i><b><i>G Means With Fisher and Tukey</i></b></p>
<p>You&#8217;ve conducted ANOVA to see whether a group of <i>K </i>Populations have the same mean, and you rejected Ho. You conclude that at least two of those populations have different means. But you don&#8217;t have to stop there; you can go on to find out how many and which means are different by conducting multiple comparison tests.</p>
<p>In this section, you see two of the most well-known multiple comparison procedures: <i>Fisher&#8217;s paired differences </i>(also known as <i>Fisher&#8217;s test </i>Or <i>Fisher&#8217;s LSD) </i>And <i>Tukey&#8217;s simultaneous confidence intervals </i>(also known as <i>Tukey&#8217;s test).</i></p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-97.jpg" width="57" height="60" class=""/></p>
<p>Although I only discuss two procedures in this section, tons of other multiple comparison procedures are out there. Although the other procedures&#8217; methods differ a great deal, their overall goal is the same: to figure out which population means differ by comparing their sample means.</p>
<p><b><i>Fishing for differences With Fisher&#8217;s LSD</i></b></p>
<p>In this section, I outline Fisher&#8217;s LSD and apply it to the cell-phone example.</p>
<p><b><i>Examining Fisher&#8217;s LSD procedure</i></b></p>
<p>Suppose you&#8217;re comparing <i>K </i>Population means. Fisher&#8217;s LSD (short for <i>Least significant difference) </i>Conducts a t-test on each of the —^—h pairs of populations in the study, each one at level a = 0.05. For example, if you have four</p>
<p>Populations labeled A, B, C, D, you would have 4 ^40—— = 6 t-tests to perform: A versus B; A versus C; A versus D; B versus C; B versus D; and C versus D.</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-98.jpg" width="52" height="63" class=""/></p>
<p>The number of tests is calculated by knowing that you have <i>K </i>Possible means for the first one in the pair, then <i>K </i>- 1 left for the second one in the pair. Because the order of the means doesn&#8217;t matter, you can divide by 2 to avoid overcounting.</p>
<p>Fisher&#8217;s LSD is very straightforward, easy to conduct, and easy to understand. However, Fisher&#8217;s LSD has some issues. Because each <i>T</i>-test is conducted at a level 0.05, each test done has a 5 percent chance of making a Type I error (rejecting Ho when you shouldn&#8217;t have — see Chapter 3). Although a 5-percent error rate for each test doesn&#8217;t seem too bad, the errors have a multiplicative effect as the number of tests increases. For example, the chance of making at least one Type I error with six <i>T</i>-tests, each at level a = 0.05, is 26.50 percent, which would be your <i>Overall error rate </i>For the procedure.</p>
<p>You could help lower the error rate for Fisher&#8217;s test if you lower the value of <b>A </b>For each test from 0.05 to, say, 0.01. However, doing so makes it harder to reject Ho for each pair of means. A lower value of <b>A </b>Also doesn&#8217;t solve the error-rate problem; it just slows it down for a bit, until the number of tests gets larger, and the error rate goes back up again.</p>
<p>If you want or need to know how I arrived at the number 26.50 percent as the overall error rate in that last example, here it goes: The probability of making a Type I error for each test is 0.05. The chance of making at least one error in six tests equals one minus the probability of making no errors in six tests. The chance of not making an error in one test is 1 &#8211; <b>A </b>= 0.95. The chance of no error in six tests is this quantity times itself six times, or (0.95)6, which equals 0.735. Now take one minus this quantity to get 1 &#8211; 0.735 = 0.2650 or 26.50 percent.</p>
<p>To conduct Fisher&#8217;s LSD, go to Stat&gt;ANOVA&gt;One-way or One-way unstacked. (If your data appear in two columns with Column 1 representing the population number and Column 2 representing the response, just click One-way because your data is stacked. If your data is shown in <i>K </i>Columns, one for each of the <i>K </i>Populations, click One-way unstacked.) In either case, the next step is to highlight the data for the groups you&#8217;re comparing and click Select. Then click on Comparisons. Click on Fisher&#8217;s. The individual error rate is listed at 5 (percent), which is typical. If you want to change it, type in the desired error rate (between 0.5 and 0.001) and click OK. You may type in your error rate as a decimal, 0.05, or as a number greater than one, such as 5. Numbers greater than one are interpreted as a percentage.</p>
<p><b><i>Applying Fisher&#8217;s LSD to cell phones</i></b></p>
<p>An ANOVA procedure was done on the cell-phone data presented in Table 10-1 to compare the mean number of minutes used for four age groups. Looking at Figure 10-2, you see Ho (all the populations means are equal) was rejected. The next step is to conduct multiple comparisons by using Fisher&#8217;s LSD to see which population means differ. Figure 10-3 shows the Minitab output.</p>
<p>The first block of results shows &quot;Group 1 subtracted from&quot; where Group 1 = age 19 and under. Each line after that represents the other age groups (Group 2 = 20- to 39-year-olds, Group 3 = 40- to 59-year-olds, and Group 4 = 60 and over). Each line shows the results of comparing the mean for the other group minus the mean for Group 1. For example, the first line shows Group 2 being compared with Group 1.</p>
<p>Moving to the right in that same row, you see the confidence interval for the difference in these two means, which turns out to be -436.97 to -323.03. Because 0 isn&#8217;t contained in this interval, you conclude that these two means are different in the populations also. You can also say, because this difference <b>U,2 </b>- <b>U</b><b>4 </b>Is negative, that <b>U,2 </b>Is less than <b>U</b><b>4. </b>Or, a better way to think of it may be that <b>U</b>1 is greater than <b>|U2. </b>That is, Group 1&#8242;s mean is greater than Group 2&#8242;s</p>
<p>Mean.</p>
<p><b>Figure 10-3:</b></p>
<p>Output showing Fisher&#8217;s LSD applied to the cellphone data.</p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>Fisher</p>
</td>
<td>
<p>95% Individual Confidence Intervals</p>
</td>
</tr>
<tr>
<td>
<p>All Pairwise Comparisons</p>
</td>
</tr>
<tr>
<td>
<p>Simultaneous confidence level — 80.32%</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>1</p>
</td>
<td>
<p>Subtracted from:</p>
</td>
</tr>
<tr>
<td>
<p>Lower Center</p>
</td>
<td>
<p>Upper</p>
</td>
<td>
<p>&#8212;&#8212;&#8212;-1&#8212;&#8212;&#8212;&#8211;1&#8212;&#8212;&#8212;&#8211;1&#8212;&#8212;&#8212;&#8211;+</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>-436.97 -380.00</p>
</td>
<td>
<p>-323.03</p>
</td>
<td>
<p>(*-)</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>3</p>
</td>
<td>
<p>-147.97 -91.00</p>
</td>
<td>
<p>-34.03</p>
</td>
<td>
<p>(*-)</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>4</p>
</td>
<td>
<p>-679.97 -623.00</p>
</td>
<td>
<p>-566.03</p>
</td>
<td>
<p>(*-)</p>
</td>
</tr>
<tr>
<td>
<p>&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+</p>
</td>
</tr>
<tr>
<td>
<p>-350 0 350 700</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>Subtracted from:</p>
</td>
</tr>
<tr>
<td>
<p>Lower Center</p>
</td>
<td>
<p>Upper</p>
</td>
<td>
<p>&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212; +</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>3</p>
</td>
<td>
<p>232.03 289.00</p>
</td>
<td>
<p>3 45.97</p>
</td>
<td>
<p>(*-)</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>4</p>
</td>
<td>
<p>-299.97 -243.00</p>
</td>
<td>
<p>-186.03</p>
</td>
<td>
<p>(-*-)</p>
</td>
</tr>
<tr>
<td>
<p>&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212; +</p>
</td>
</tr>
<tr>
<td>
<p>-350 0 350 700</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>3</p>
</td>
<td>
<p>Subtracted from:</p>
</td>
</tr>
<tr>
<td>
<p>Lower Center</p>
</td>
<td>
<p>Upper</p>
</td>
<td>
<p>&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212; +</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>4</p>
</td>
<td>
<p>-588.97 -532.00</p>
</td>
<td>
<p>-475.03</p>
</td>
<td>
<p>(-*)</p>
</td>
</tr>
<tr>
<td>
<p>&#8212;&#8212;&#8212;3-5+0&#8212;&#8212;&#8212;+0&#8212;&#8212;&#8211;3-50+&#8212;&#8212;&#8211;7-0+0</p>
</td>
</tr>
</table>
<p>Each subsequent row in the &quot;Group 1 subtracted from&quot; section of Figure 10-3 shows similar results. None of the confidence intervals contain 0, so you conclude that the mean cell-phone use for Group 1 isn&#8217;t equal to the mean cellphone use for any other group. Moreover, because all confidence intervals are in negative territory, you can conclude that the mean cell-phone use time for those 19 and under is greater than all the others. This process continues as you move down through the output until all six pairs of means are compared. Then you put them all together into one conclusion.</p>
<p>For example, in the second portion of the output, Group 2 is subtracted from Groups 3 and 4. You see the confidence interval for the &quot;Group 3&quot; line is 232.03, 345.97; this gives possible values for Group 3&#8242;s mean minus Group 2&#8242;s mean. The interval is entirely positive, so conclude that Group 3&#8242;s mean is greater than Group 2&#8242;s mean (according to this data). On the next line, the interval for Group 4 minus Group 2 is -299.97 to -186.03. All these numbers are negative, so conclude Group 4&#8242;s mean is less than Group 2&#8242;s. Combine conclusions to say that Group 3&#8242;s mean is greater than Group 2&#8242;s, which is greater than Group 4&#8242;s.</p>
<p>In the cell-phone example, none of the means are equal to each other, and based on the signs of confidence intervals and the results of all the individual pairwise comparisons, the following order of cell-phone mean usage prevails: <b>U</b><b>4 </b>&gt; <b>U,3 </b>&gt; <b>U,2&gt; u,4. </b>(Hypothetical data aside, it might be the case that 40- to 59-year-olds use a lot of cell phone time because of their jobs.)</p>
<p>Notice near the top of Figure 10-3 that you see &quot;simultaneous confidence level = 80.32 percent.&quot; That means the overall error rate for this procedure is 1 &#8211; 0.8032 = 0.1968, which is close to 20 percent.</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-99.jpg" width="62" height="60" class=""/></p>
<p><b><i>Separating the turkeys with </i></b><b><i>T</i></b><b><i>Ukey&#8217;s test</i></b></p>
<p>This section dives into Tukey&#8217;s test and applies it to the cell-phone example.</p>
<p><b><i>Setting up Tukey&#8217;s test</i></b></p>
<p>The basic idea behind Tukey&#8217;s test is to provide a series of simultaneous confidence intervals for the differences in the means. It still examines all possible pairs of means and keeps the overall error rate (also known as the <i>Familywise error rate) </i>At a (like Fishers LSD), but it also keeps the individual Type I error rate for each pair of means at a as well. This difference takes care of a lot of issues raised with Fisher&#8217;s LSD procedure (refer to the preceding section).</p>
<p>Although the details of the formulas used for Tukey&#8217;s test are beyond the scope of this book, they&#8217;re not based on the t-test, but rather something called a <i>Stu-dentized range statistic, </i>Which is based on the highest and lowest means in the group, and their difference. The individual error rates are held at 0.05 because Tukey developed a cutoff value for his test statistic, which is based on all pair-wise comparisons (no matter how many means are in each group).</p>
<p>If you calculate the results by hand, you can look at tables to make your conclusions. However, all applications I have ever seen both in the classroom and outside of it use a computer for these calculations. (For sanity&#8217;s sake, I suggest you do the same.)</p>
<p>To conduct Tukey&#8217;s test, go to Stat&gt;ANOVA&gt;One-way or One-way unstacked. (If your data appears in two columns with Column 1 representing the population number and Column 2 representing the response, just click One-way because your data is stacked. If your data is shown in <i>K </i>Columns, one for each of the <i>K </i>Populations, click One-way unstacked.) The next step is to highlight the data for the groups you&#8217;re comparing and click Select. Then click on Comparisons. Click on Tukey&#8217;s. The familywise (overall) error rate is listed at 5 (percent), which is typical. If you want to change it, type in the desired error rate (between 0.5 and 0.001) and click OK. You may type in your error rate as a decimal, such as 0.05, or as a number greater than one, such as 5. Numbers greater than one are interpreted as a percentage.</p>
<p><b><i>Doing Tukey&#8217;s test on the cell phone data</i></b></p>
<p>The Minitab output for comparing the groups regarding cell-phone use by using Tukey&#8217;s test appears in Figure 10-4. Looking at Figure 10-4, you see that its results can be interpreted in the same was as for Figure 10-3. Some of the numbers in the confidence intervals are different, but in this case, the main conclusions are the same: Those 19 and under use their cell phones most, followed by 40- to 59-year-olds, then 20- to 39-year-olds, and finally those 60 and over.</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-100.jpg" width="57" height="60" class=""/></p>
<p>The results of Fisher and Tukey don&#8217;t always agree, usually because the overall error rate of Fisher&#8217;s procedure is larger than Tukey&#8217;s (except when only two means are involved). Most statisticians I know prefer Tukey&#8217;s procedure over Fisher&#8217;s. That doesn&#8217;t mean they don&#8217;t have other procedures they like even better than Tukey&#8217;s, but Tukey&#8217;s is the most common procedure, and many people like to use it.</p>
<p><b>Figure 10-4:</b></p>
<p>Output for Tukey&#8217;s test used to compare cell-phone usage.</p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>Tukey</p>
</td>
<td>
<p>95% Simultaneous Confidence Intervals</p>
</td>
</tr>
<tr>
<td>
<p>All Pairwise Comparisons</p>
</td>
</tr>
<tr>
<td>
<p>Individual confidence level — 98.93%</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>1</p>
</td>
<td>
<p>Subtracted from:</p>
</td>
</tr>
<tr>
<td>
<p>Lower Center</p>
</td>
<td>
<p>Upper</p>
</td>
<td>
<p>+&#8212;&#8212;&#8212;&#8211;1&#8212;&#8212;&#8212;&#8211;1&#8212;&#8212;&#8212;&#8211;1&#8212;&#8212;&#8212;-</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>-455.68 -380.00</p>
</td>
<td>
<p>-304.32</p>
</td>
<td>
<p>(-*-)</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>3</p>
</td>
<td>
<p>-166.68 -91.00</p>
</td>
<td>
<p>-15.32</p>
</td>
<td>
<p>(-*-)</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>4</p>
</td>
<td>
<p>-698.68 -623.00</p>
</td>
<td>
<p>-547.32</p>
</td>
<td>
<p>(-*-)</p>
</td>
</tr>
<tr>
<td>
<p>-7</p>
</td>
<td>
<p>)0 &#8212;0 0 &#8211;0</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>Subtracted from:</p>
</td>
</tr>
<tr>
<td>
<p>Lower Center</p>
</td>
<td>
<p>Upper</p>
</td>
<td>
<p>+&#8212;&#8212;&#8212;O&#8212;&#8212;&#8212;O&#8212;&#8212;&#8212;O&#8212;&#8212;&#8212;</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>3</p>
</td>
<td>
<p>213.32 289.00</p>
</td>
<td>
<p>3 6 4.68</p>
</td>
<td>
<p>(-*-)</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>4</p>
</td>
<td>
<p>-318.68 -243.00</p>
</td>
<td>
<p>-16 7.32</p>
</td>
<td>
<p>(-*-)</p>
</td>
</tr>
<tr>
<td>
<p>0&#8212;&#8212;&#8212;0&#8212;&#8212;&#8212;0&#8212;&#8212;&#8212;0&#8212;&#8212;&#8212;</p>
</td>
</tr>
<tr>
<td>
<p>-700 -350 0 350</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>3</p>
</td>
<td>
<p>Subtracted from:</p>
</td>
</tr>
<tr>
<td>
<p>Lower Center</p>
</td>
<td>
<p>Upper</p>
</td>
</tr>
<tr>
<td>
<p>Group</p>
</td>
<td>
<p>4</p>
</td>
<td>
<p>-607.68 -532.00</p>
</td>
<td>
<p>-456.32</p>
</td>
<td>
<p>0&#8212;&#8212;&#8212;0&#8212;&#8212;&#8212;0&#8212;&#8212;&#8212;0&#8212;&#8212;&#8212;</p>
</td>
</tr>
<tr>
<td>
<p>-7</p>
</td>
<td>
<p>0 -350 0 350</p>
</td>
</tr>
</table>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-101.png" width="49" height="45" class=""/></p>
<p>Another multiple comparison procedure is listed on Minitab&#8217;s repertoire after you ask it to do multiple comparisons. This procedure is called <i>Dunnett&#8217;s test. </i>Dunnett&#8217;s test is a special multiple comparison procedure used in a designed experiment that contains a control group. The test compares each treatment group to the control group and determines which treatments do better than others that way. Dunnett&#8217;s test is better able to find real differences in this situation than other multiple comparison procedures, because it focuses only on the differences between each treatment and the control — not the differences between every single pair of treatments in the entire study.</p></p>
</sape_index><!--c715886456-->]]></content:encoded>
			<wfw:commentRss>http://ankar.info/2010/05/15/pairing-things-down-with-multiple-comparisons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting a Little Interaction with Two-Way ANOVA</title>
		<link>http://ankar.info/2010/05/15/getting-a-little-interaction-with-two-way-anova/</link>
		<comments>http://ankar.info/2010/05/15/getting-a-little-interaction-with-two-way-anova/#comments</comments>
		<pubDate>Sat, 15 May 2010 18:30:15 +0000</pubDate>
		<dc:creator>Анкар</dc:creator>
				<category><![CDATA[Comparing Many Means with ANOVA]]></category>

		<guid isPermaLink="false">http://ankar.info/2010/05/15/getting-a-little-interaction-with-two-way-anova/</guid>
		<description><![CDATA[In This Chapter ^ Building and carrying out ANOVA with two factors ^ Getting familiar with (and looking for) interaction effects and main effects ^ Putting the terms to the test ^ Demystifying the two-way ANOVA table J\ Nalysis of variance (ANOVA) is often used in experiments to see whether T \ Different levels of [...]]]></description>
			<content:encoded><![CDATA[<sape_index><p><b><i>In This Chapter</i></b></p>
<p>^ Building and carrying out ANOVA with two factors</p>
<p>^ Getting familiar with (and looking for) interaction effects and main effects</p>
<p>^ Putting the terms to the test</p>
<p>^ Demystifying the two-way ANOVA table</p>
<p><b><i>J\ </i></b><i>Nalysis of variance </i>(ANOVA) is often used in experiments to see whether <b><i>T \ </i></b>Different levels of an explanatory variable <i>(x) </i>Get different results on some quantitative variable <i>Y. </i>(See Chapter 9.) The <i>X </i>Variable in this case is called a <i>Factor, </i>And it has certain levels to it, depending on how the experiment is set up. For example, say you want to compare the average reduction in blood pressure on certain dosages of a drug. The factor is drug dosage. Suppose it has three levels: 10mg per day, 20mg per day, or 30mg per day. Suppose someone else studies the response to that same drug and examines whether the times taken per day (one time or two times) has any effect on blood pressure. In this case, the factor is number of times per day, and it has two levels: once and twice.</p>
<p>Suppose you want to study the effects of dosage <i>And </i>Number of times taken together, because you believe both may have an affect on the response. So what you have is called a <i>Two-way ANOVA, </i>Using two factors together to compare the average response. So it&#8217;s an extension of one-way ANOVA (refer to Chapter 9) with a twist, because the two factors you use may operate on the response differently together than they would separately.</p>
<p>In this chapter, you examine two-way ANOVA — setting up the model, making your way through the ANOVA table, taking the <i>F</i>-tests, and drawing the appropriate conclusions.</p>
<p><b><i>Setting Up the Two-Way ANOVA Model</i></b></p>
<p>The two-way ANOVA model extends the ideas of the one-way ANOVA model and adds an interaction term to examine how various combinations of the two factors affect the response. In this section, you see the building blocks of a two-way ANOVA: the treatments, main effects, the interaction term, and the sums of squares equation that puts everything together.</p>
<p><b><i>Determining the treatments</i></b></p>
<p>The two-way ANOVA model contains two factors, <i>A </i>And <i>B, </i>And each factor has a certain number of levels (say <i>I </i>Levels of factor A and <i>J </i>Levels of factor B). In the drug study example from the chapter intro, you have A = drug dosage with <i>I </i>= 1, 2, or 3 and B = number of times taken per day with <i>J </i>= 1 or 2. Each person involved in the study is subject to one of the three different drug dosages and will take the drug in one of the two methods given. That means you have 3 * 2 = 6 different combinations of factors A and B that you can apply to the subjects, and you can study it in the two-way ANOVA model.</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-102.jpg" width="57" height="60" class=""/></p>
<p>Each different combination of levels of factors A and B is called a <i>Treatment </i>In the model. Table 11-1 shows the six treatments in the drug study. For example, Treatment 4 is the combination of 20mg of the drug taken in two doses of 10mg each per day.</p>
<table class=msonormaltable border=1 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p><b>Table 11-1</b></p>
</td>
<td>
<p><b>The Six Treatment Combinations for the Drug Study</b></p>
</td>
</tr>
<tr>
<td>
<p><b><i>Amount</i></b></p>
</td>
<td>
<p><b><i>One Time/Day</i></b></p>
</td>
<td>
<p><b><i>Two Times/Day</i></b></p>
</td>
</tr>
<tr>
<td>
<p>10mg</p>
</td>
<td>
<p>Treatment 1</p>
</td>
<td>
<p>Treatment 2</p>
</td>
</tr>
<tr>
<td>
<p>20mg</p>
</td>
<td>
<p>Treatment 3</p>
</td>
<td>
<p>Treatment 4</p>
</td>
</tr>
<tr>
<td>
<p>30mg</p>
</td>
<td>
<p>Treatment 5</p>
</td>
<td>
<p>Treatment 6</p>
</td>
</tr>
</table>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-103.jpg" width="52" height="63" class=""/></p>
<p>If factor A has <i>I </i>Levels and factor B has <i>J</i>Levels, you have <i>I * j</i>Different combinations of treatments in your two-way ANOVA model.</p>
<p><b><i>Stepping through the sums of squares</i></b></p>
<p>The two-way ANOVA model contains three terms:</p>
<p><b>The main effect A: </b>A term for the effect of factor A on the response</p>
<p><b>The main effect B: </b>A term for the effect of factor B on the response</p>
<p><b>The interaction of A and B: </b>The effect of the combination of factors A and B (denoted AB)</p>
<p>The sums of squares equation for the one-way ANOVA (see Chapter 9) is SSTO = SST + SSE, where SSTO is the total variability in the response variable, y; SST is the variability explained by the treatment variable (call it factor A); and SSE is the variability left over as error. The purpose of this model is to test to see whether the different levels of factor A produce different responses in the <i>Y </i>Variable. The way you do it is by using Ho: <b>U</b><b>4 </b>= <b>U,2 </b>= . . . = <b>U,,-, </b>Where <i>I </i>Is the number of levels of factor A (the treatment variable). If you reject Ho, then factor A (which separates the data into the groups being compared) is significant. If you can&#8217;t reject Ho, you can&#8217;t conclude that factor A is significant.</p>
<p>In the two-way ANOVA, you add another factor to the mix (B) plus an interaction term (AB). The sums of squares equation for the two-way ANOVA model is SSTO = SSA + SSB + SSAB + SSE. Here SSTO is the total variability in the <i>Y</i>-values; SSA is the sums of squares due to factor A (representing the variability in the y-values explained by factor A.); and similarly for SSB and factor B. SSAB is the sums of squares due to the interaction of factors A and B, and SSE is the amount of variability left unexplained, and deemed error. (While the mathematical details of all the formulas for these terms are unwieldy and beyond the focus of this book, they just extend the formulas for one-way ANOVA found in Chapter 9. ANOVA handles the calculations for you, so you don&#8217;t have to worry about that part.)</p>
<p>To carry out a two-way ANOVA in Minitab, enter your data in three columns. Column 1 contains the responses (the actual data). Column 2 represents the level of factor A (Minitab calls it the row factor). Column 3 represents the level of factor B (Minitab calls it the <i>Column factor). </i>Go to Stat&gt;Anova&gt;Two-way. Click on Column 1 in the left-hand box and it appears in the Response box on the right-hand side. Click on Column 2 and it appears in the row factor box; click on Column 3 and it appears in the column factor box. Click OK.</p>
<p>For example, suppose you have six data values in Column 1: 11, 21, 38, 14, 15, 62. Suppose Column 2 contains 1, 1, 1, 2, 2, 2, and Column 3 contains 1, 2, 3, 1, 2, 3. This means that factor A has two levels (1, 2), and factor B has three levels (1, 2, 3). The number 11 was the response when Level 1 of factor A and Level 1 of factor B were applied. The second data value, 21, came from Level 1 of A and Level 2 of B. The third value, 38, came from Level 1 of A and Level 3 of B. The fourth number, 14, came from Level 2 of A and Level 1 of B. The number 15 is the response from Level 2 of A and Level 2 of B, and finally, the number 62 corresponds to the result of Level 2 of A and Level 3 of B.</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-104.jpg" width="59" height="45" class=""/></p>
<p>Suppose factor A has <i>I </i>Levels and factor B has <i>J </i>Levels, with a sample of size <i>M </i>Collected on each combination of A and B. The degrees of freedom for factor A, factor B, and the interaction term AB are <b>(i </b>- 1), <i>(j </i>- 1), and <b>(i </b>- 1) <b>* </b><i>(j </i>- 1) respectively. This formula is just an extension of the degrees of freedom for the one-way model for factors A and B. The degrees of freedom for SSTO is <i>I </i><b>* </b><i>J </i><b>* </b><i>M </i>- 1, and the degrees of freedom for SSE is <i>I </i><b>* </b><i>J </i><b>* (m </b>- 1).</p>
<p><b><i>Understanding Interaction Effects</i></b></p>
<p>The interaction effect is the heart of the two-way ANOVA model. Knowing that the two factors may act together in a different way than they would separately is important and must be taken into account. In this section, you see the many ways in which the interaction term AB and the main effects of factors A and B affect the response variable in a two-way ANOVA model.</p>
<p><b><i>What is interaction anyway?</i></b></p>
<p>Interaction is when two factors meet, or interact with each other, on the response in a way that&#8217;s different from how each factor affects the response separately. For example, before you can test to see whether dosage of medicine (factor A) or number of times taken (factor B) are important in explaining changes in blood pressure, you have to look at how they operate together to affect blood pressure. That is, you have to examine the interaction term.</p>
<p>Suppose you&#8217;re taking one type of medicine for cholesterol and one medicine for a heart problem. Suppose researchers only looked at the effects of each drug alone, saying each one was good for managing the problem for which it was designed, with little to no side effects. Now you come along and mix the two drugs in your system. As far as the individual study results are concerned, all bets are off. With only those separate studies to go on, they will have no idea how the drugs will interact with each other, and you can be in a great deal of trouble very quickly. Fortunately, drug companies and medical researchers do a great deal of work studying drug interactions, and your pharmacist knows which drugs interact as well. You can bet a statistician was involved in this work from day one!</p>
<p>Baking is another good example of how interaction works. Slurp down one raw egg, drink a cup of milk, and eat a cup of sugar, a cup of flour, and a stick of margarine. Then eat a cup of chocolate chips. Each one of these items has a certain taste, texture, and affect on your taste buds that, in most cases, won&#8217;t be all that great. But mix them all together in a bowl and voila! You have a batch of chocolate chip cookie dough, thanks to the magic effects of interaction.</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-105.jpg" width="57" height="54" class=""/></p>
<p><b><i>Interacting with interaction plots</i></b></p>
<p>In the two-way ANOVA model, you have two factors and their interaction. A number of results could come out of this model in terms of significance of the individual terms, as you can see in the following:</p>
<p>Factors A and B are both significant. Factor A is significant but not factor B. Factor B is significant but not factor A. Neither factors A nor B are significant. The interaction term AB is significant.</p>
<p>Figure 11-1 depicts each of these five situations, respectively, in terms of a diagram, using the drug-study example. Plots that show how factors A and B react separately and together on the response variable <i>Y </i>Are called <i>Interaction plots. </i>In the following sections, I describe each of these five situations in detail in terms of what the plots are telling you and what the results mean in the context of an example.</p>
<p><b><i>Factors A and B are significant</i></b></p>
<p>Figure 11-1a shows the situation when both A and B are significant in the model (no interaction present). The lines represent the levels of the times-per-day factor (B); the <b>X</b>-axis represents the levels of the dosage factor (A); and the <b>Y</b>-axis represents the average value of the response variable <b>Y, </b>Change in blood pressure, at each combination of treatments.</p>
<p>The top line moving across Figure 11-1a shows that when the drug is taken two times per day, the change in blood pressure increases with dosage level. The bottom line shows the same thing happens when the drug is taken once per day, except that the effects on blood pressure are lower overall than the effects of taking the drug twice a day. That means factor A is significant because blood pressure changes across dosage levels, and factor B is significant because blood pressure is different from one line to another. (Assume the difference is large enough to be significant.) Here the different combinations of factors A and B don&#8217;t affect the overall trends, so there&#8217;s no interaction effect.</p>
<p>Two parallel lines in an interaction plot means a lack of an interaction effect. In the drug-study example, the levels of A don&#8217;t change blood pressure differently for different levels of B.</p>
<p><b><i>Factor A is significant but not factor B</i></b></p>
<p>Figure 11-1b shows that blood pressure changes across dosage levels for taking the drug once or twice a day. However, the two lines are so close</p>
<p>Together that whether you take the drug once or twice a day has no effect. So factor A (dosage) is significant, and factor B (times per day) isn&#8217;t. Parallel lines again means no interaction effect.</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-106.png" width="96" height="58" class=""/></p>
<p>2 times/day 1 time/day</p>
<p>10mg 20mg 30mg (dosage)</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-107.png" width="96" height="36" class=""/></p>
<p>2 times/day 1 time/day</p>
<p>10mg 20mg 30mg (dosage)</p>
<p>-• 2 times/day -• 1 time/day</p>
<p>10mg 20mg 30mg (dosage)</p>
<p><b>Figure 11-1:</b></p>
<p>Five</p>
<p>Examples of the results from a two-way ANOVA with interaction.</p>
<p>2 times/day ~* 1 time/day</p>
<p>10mg 20mg 30mg (dosage)</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-108.png" width="96" height="57" class=""/></p>
<p>2 times/day</p>
<p>1 time/day</p>
<p>10mg 20mg 30mg</p>
<p>A.</p>
<p>B.</p>
<p>C.</p>
<p>D.</p>
<p>E.</p>
<p><b><i>Factor B is significant but not factor A</i></b></p>
<p>Figure 11-1c shows where factor B is significant but A isn&#8217;t. The lines are flat across dosage levels indicating that dosage has no effect on blood pressure. However, the two lines for times per day are spread apart, so their effect on blood pressure is significant. Parallel lines mean no interaction effect.</p>
<p><b><i>Neither factor is significant</i></b></p>
<p>Figure 11-1d shows two flat lines that are very close to each other. By the previous discussions about Figures 11-1b and 11-1c, you can guess that this figure represents the case where neither factor A nor factor B are significant, and you don&#8217;t have an interaction effect because the lines are parallel.</p>
<p><b><i>Interaction term is significant</i></b></p>
<p>Finally you get to Figure 11-1e, the most interesting interaction plot of all. The big picture is that because the two lines cross, then factors A and B interact with each other in the way that they operate on the response. If they didn&#8217;t interact, then the lines would be parallel.</p>
<p>Start with the top line of Figure 11-1e. When you take the drug two times per day at the low dose, you get a low change in blood pressure; as you increase dosage, blood pressure increases also. But when you take the drug once per day, the opposite result happens.</p>
<p>If you didn&#8217;t look for a possible interaction effect before you examined the main effects, you may have thought no matter how many times you take this drug per day, the effects will be the same. Not so! Always check out the interaction term first in any two-way ANOVA. If the interaction term is significant, you have no way to pull out the effects due to just factor A or just factor B; they&#8217;re moot. Checking the main effects of factor A or B without checking out the interaction AB term is considered a no-no in the two-way ANOVA world. Another taboo is examining the factors individually (also known as the main effect) if the interaction term is significant.</p>
<p><b><i>Testing the Terms in Two-Way ANOVA</i></b></p>
<p>In a one-way ANOVA, you have only one hypothesis test. You use an F-test to determine whether the means of the <i>Y </i>Values are the same or different as you go across the levels of the one factor. In two-way ANOVA you have more items to test besides the overall model. You have the interaction term AB and possibly the main effects of A and B. Each test in a two-way ANOVA is an F-test based on the ideas of one-way ANOVA (see Chapter 9 for more on this).</p>
<p>First, you test whether the interaction term AB is significant. To do this, you use the test statistic <i>F = </i><b>,,p </b>, which has an F-distribution with (/ &#8211; 1) * ( <i>J </i>- 1) degrees of freedom from MSAB (mean sum of squares for the interaction term</p>
<p>Of A and B) and <i>I * j * (m </i>- 1) degrees of freedom from MSE (mean sum of squares for error), respectively. (Recall that <i>I </i>And <i>J </i>Are the number of levels of A and B, and <i>M </i>Is the sample size at each combination of A and B.) You basically want to see whether more of the total variability in the y&#8217;s can be explained by the AB term compared to what is left in the error term. A large value of <i>F </i>Means that the AB term is significant, and you leave it in the model.</p>
<p>If the interaction term isn&#8217;t significant, you take the AB term out of the model, and you can explore the effects of factors A and B separately regarding the</p>
<p>Response variable <i>Y. </i>The test for Factor A uses the test statistic <i>F = </i>,</p>
<p>Which has an F-distribution with <i>I </i>- 1 degrees of freedom from MSA (mean sum of squares for factor A) and <i>I </i>* <i>J* (m </i>- 1) degrees of freedom from MSE (mean</p>
<p><b>,&nbsp;,&nbsp;. , t, . , ,&nbsp;t,&nbsp;</b><b>R, </b><i>MS B</i></p>
<p>Sum of squares for error), respectively. Jesting for factor B uses <i>F = </i>, which has an F-distribution with <i>J </i>- 1 and <i>I </i>* <i>J </i>* (m &#8211; 1) degrees of freedom.</p>
<p>The results you can get from testing the terms of the ANOVA model are the same as those represented in Figure 11-1. They&#8217;re all provided in Minitab output outlined in the next section, including their sum of squares, degrees of freedom, mean sum of squares, and p-values for their appropriate F-tests.</p>
<p><b><i>Running the Two-Way ANOVA Table</i></b></p>
<p>The ANOVA table for two-way ANOVA includes the same elements as the ANOVA table for one-way ANOVA (see Chapter 9). But where in the one-way ANOVA you had one line for Factor A&#8217;s contributions, now you add lines for the effects of Factor B and the interaction term AB. Minitab calculates the ANOVA table for you as part of the output from running a two-way ANOVA.</p>
<p>In this section, you can figure out how to interpret the results of a two-way ANOVA, assess the model&#8217;s fit, and use a multiple comparisons procedure, using the drug-data study.</p>
<p><b><i>Interpreting the results: Numbers and graphs</i></b></p>
<p>The drug-study example has, say, four people in each treatment combination of three possible dosage levels (10, 20, 30mg per day) and two possible times for taking the drug (one time per day and two times per day). The total sample size is 4 * 3 * 2 = 24. I made up five different data sets in which the analyses represent each of the five scenarios shown in Figure 11-1. Their ANOVA tables, as created by Minitab, are shown in Figure 11-2.</p>
<p>The order of the graphs in Figure 11-1 and the ANOVA tables in Figure 11-2 isn&#8217;t the same. Can you match them up? (I promise to give you the answers, so keep reading.)</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-109.jpg" width="57" height="60" class=""/></p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>Two-way ANOVA: BP</p>
</td>
<td>
<p>Versus Dosage, Times</p>
</td>
</tr>
<tr>
<td>
<p>Scarce</p>
</td>
<td>
<p>DF</p>
</td>
<td>
<p>SS</p>
</td>
<td>
<p>MS F</p>
</td>
<td>
<p>P</p>
</td>
</tr>
<tr>
<td>
<p>Dosage</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>56.3333</p>
</td>
<td>
<p>28.1667 112.67</p>
</td>
<td>
<p>0.000</p>
</td>
</tr>
<tr>
<td>
<p>Times</p>
</td>
<td>
<p>1</p>
</td>
<td>
<p>4.1667</p>
</td>
<td>
<p>4.1667 16.67</p>
</td>
<td>
<p>0.001</p>
</td>
</tr>
<tr>
<td>
<p>Interaction</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>0.3333</p>
</td>
<td>
<p>0.1667 0.67</p>
</td>
<td>
<p>0.526</p>
</td>
</tr>
<tr>
<td>
<p>Error</p>
</td>
<td>
<p>18</p>
</td>
<td>
<p>4.5000</p>
</td>
<td>
<p>0.2500</p>
</td>
</tr>
<tr>
<td>
<p>Total</p>
</td>
<td>
<p>23</p>
</td>
<td>
<p>65.3333</p>
</td>
</tr>
<tr>
<td>
<p>S = 0.5</p>
</td>
<td>
<p>R-Sq = 93.11%</p>
</td>
<td>
<p>R-Sq(adj) =</p>
</td>
<td>
<p>91.20%</p>
</td>
</tr>
<tr> </tr>
<tr>
<td>
<p>Two-way ANOVA: BP</p>
</td>
<td>
<p>Versus Dosage, Times</p>
</td>
</tr>
<tr>
<td>
<p>Source</p>
</td>
<td>
<p>DF</p>
</td>
<td>
<p>SS</p>
</td>
<td>
<p>MS F</p>
</td>
<td>
<p>P</p>
</td>
</tr>
<tr>
<td>
<p>Dosage</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>0.0833</p>
</td>
<td>
<p>0.04167 0.16</p>
</td>
<td>
<p>0.855</p>
</td>
</tr>
<tr>
<td>
<p>Times</p>
</td>
<td>
<p>1</p>
</td>
<td>
<p>0.3750</p>
</td>
<td>
<p>0.37500 1.42</p>
</td>
<td>
<p>0.249</p>
</td>
</tr>
<tr>
<td>
<p>Interaction</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>16.7500</p>
</td>
<td>
<p>8.37500 31.74</p>
</td>
<td>
<p>0.000</p>
</td>
</tr>
<tr>
<td>
<p>Error</p>
</td>
<td>
<p>18</p>
</td>
<td>
<p>4.7500</p>
</td>
<td>
<p>0.26389</p>
</td>
</tr>
<tr>
<td>
<p>Total</p>
</td>
<td>
<p>23</p>
</td>
<td>
<p>21.9583</p>
</td>
</tr>
<tr>
<td>
<p>S = 0.5137</p>
</td>
<td>
<p>R-Sq = 78.37%</p>
</td>
<td>
<p>R-Sq(adj) =</p>
</td>
<td>
<p>72.36%</p>
</td>
</tr>
</table>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>Two-way ANOVA: BP</p>
</td>
<td>
<p>Versus</p>
</td>
<td>
<p>Dosage, Times</p>
</td>
</tr>
<tr>
<td>
<p>Source</p>
</td>
<td>
<p>DF</p>
</td>
<td>
<p>SS</p>
</td>
<td>
<p>MS</p>
</td>
<td>
<p>F</p>
</td>
<td>
<p>P</p>
</td>
</tr>
<tr>
<td>
<p>Dosage</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>0.0833</p>
</td>
<td>
<p>0.041667</p>
</td>
<td>
<p>0.08</p>
</td>
<td>
<p>0.926</p>
</td>
</tr>
<tr>
<td>
<p>Times</p>
</td>
<td>
<p>1</p>
</td>
<td>
<p>0.3750</p>
</td>
<td>
<p>0.375000</p>
</td>
<td>
<p>0.69</p>
</td>
<td>
<p>0.416</p>
</td>
</tr>
<tr>
<td>
<p>Interaction</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>0.7500</p>
</td>
<td>
<p>0.375000</p>
</td>
<td>
<p>0.69</p>
</td>
<td>
<p>0.513</p>
</td>
</tr>
<tr>
<td>
<p>Error</p>
</td>
<td>
<p>18</p>
</td>
<td>
<p>9.7500</p>
</td>
<td>
<p>0.541667</p>
</td>
</tr>
<tr>
<td>
<p>Total</p>
</td>
<td>
<p>23</p>
</td>
<td>
<p>10.9583</p>
</td>
</tr>
</table>
<p>S = 0.7360</p>
<p>R-Sq = 11.03%</p>
<p>R-Sq(adj) = 0.00%</p>
<p><b>Figure 11-2:</b></p>
<p>ANOVA tables for the interaction plots from Figure 11-1.</p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>Two-way ANOVA: BP</p>
</td>
<td>
<p>Versus</p>
</td>
<td>
<p>Dosage, Times</p>
</td>
</tr>
<tr>
<td>
<p>Source</p>
</td>
<td>
<p>DF</p>
</td>
<td>
<p>SS</p>
</td>
<td>
<p>MS</p>
</td>
<td>
<p>F</p>
</td>
<td>
<p>P</p>
</td>
</tr>
<tr>
<td>
<p>Dosage</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>36.7500</p>
</td>
<td>
<p>18.3750</p>
</td>
<td>
<p>47.25</p>
</td>
<td>
<p>0.000</p>
</td>
</tr>
<tr>
<td>
<p>Times</p>
</td>
<td>
<p>1</p>
</td>
<td>
<p>0.6667</p>
</td>
<td>
<p>0.6667</p>
</td>
<td>
<p>1.71</p>
</td>
<td>
<p>0.207</p>
</td>
</tr>
<tr>
<td>
<p>Interaction</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>0.0833</p>
</td>
<td>
<p>0.0417</p>
</td>
<td>
<p>0.11</p>
</td>
<td>
<p>0.899</p>
</td>
</tr>
<tr>
<td>
<p>Error</p>
</td>
<td>
<p>18</p>
</td>
<td>
<p>7.0000</p>
</td>
<td>
<p>0.3889</p>
</td>
</tr>
<tr>
<td>
<p>Total</p>
</td>
<td>
<p>23</p>
</td>
<td>
<p>44.5000</p>
</td>
</tr>
</table>
<p>S = 7.6236</p>
<p>R-Sq = 84.27%</p>
<p>R-Sq(adj) = 79.90%</p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>Two-way ANOVA: BP</p>
</td>
<td>
<p>Versus</p>
</td>
<td>
<p>Dosage, Times</p>
</td>
</tr>
<tr>
<td>
<p>Source</p>
</td>
<td>
<p>DF</p>
</td>
<td>
<p>SS</p>
</td>
<td>
<p>MS</p>
</td>
<td>
<p>F</p>
</td>
<td>
<p>P</p>
</td>
</tr>
<tr>
<td>
<p>Dosage</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>0.0833</p>
</td>
<td>
<p>0.0417</p>
</td>
<td>
<p>0.16</p>
</td>
<td>
<p>0.855</p>
</td>
</tr>
<tr>
<td>
<p>Times</p>
</td>
<td>
<p>1</p>
</td>
<td>
<p>12.0417</p>
</td>
<td>
<p>12.0417</p>
</td>
<td>
<p>45.63</p>
</td>
<td>
<p>0.000</p>
</td>
</tr>
<tr>
<td>
<p>Interaction</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>0.0833</p>
</td>
<td>
<p>0.0417</p>
</td>
<td>
<p>0.16</p>
</td>
<td>
<p>0.855</p>
</td>
</tr>
<tr>
<td>
<p>Error</p>
</td>
<td>
<p>18</p>
</td>
<td>
<p>4.7500</p>
</td>
<td>
<p>0.2639</p>
</td>
</tr>
<tr>
<td>
<p>Total</p>
</td>
<td>
<p>23</p>
</td>
<td>
<p>16.9583</p>
</td>
</tr>
</table>
<p>S = 0.5137</p>
<p>R-Sq = 71.99%</p>
<p>R-Sq(adj) = 64.21%</p>
<p>A</p>
<p>B</p>
<p>C</p>
<p>D</p>
<p>E</p>
<p>Notice that each ANOVA table in Figure 11-2 shows the degrees of freedom for dosage is 3 &#8211; 1 = 2; the degrees of freedom for times per day is 2 &#8211; 1 = 1; the degrees of freedom for the interaction term is (3 &#8211; 1)(2 &#8211; 1) = 2; the</p>
<p>Degrees of freedom for total is 3 * 2 * 4 &#8211; 1 = 23; and degrees of freedom for error is 3 * 2 * (4 &#8211; 1) = 18.</p>
<p>Here are the answers to match the graphs from Figure 11-1 with the output from Figure 11-2:</p>
<p>In the ANOVA table for Figure 11-2a, you see that the interaction term isn&#8217;t significant (p-value = 0.526), so the main effects can be studied. The p-values for dosage and times taken are 0.000 and 0.001, indicating both factors A and B respectively are significant; this matches the plot in Figure 11-1a.</p>
<p>In Figure 11-2b, you see that the p-value for interaction is significant (p-value = 0.000) so you can&#8217;t examine the main effects of factors A and B (in other words, don&#8217;t look at their <i>P</i>-values). This represents the situation in Figure 11-1e.</p>
<p>Figure 11-2c shows nothing is significant (p-value for interaction term is 0.513; p-values for main effects of A (dosage) and B (times taken) are 0.926 and 0.416, respectively). These results coincide with Figure 11-1d.</p>
<p>Figure 11-2d matches Figure 11-1b, with no interaction effect (p-value = 0.899), dosage (factor A) is significant <i>(p</i>-value = 0.000), and times per day (factor B) isn&#8217;t (p-value = 0.207).</p>
<p>Figure 11-2e matches Figure 11-c. Dosage * times per day is not significant <i>(p</i>-value = 0.855); times per day is significant with <i>P</i>-value 0.000 but not dosage level <i>(p</i>-value = 0.855).</p>
<p><b><i>Assessing the fit</i></b></p>
<p>To assess the fit of the two-way ANOVA models, you can use the <i>R2 </i>Adjusted (see Chapter 5). The higher this number is, the better (the maximum is 100 percent or 1.00). Notice that all the ANOVA tables in Figure 11-2 show a fairly high <i>R2 </i>Adjusted except for Figure 11-2c. In this table, none of the terms was significant.</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-110.jpg" width="59" height="45" class=""/></p>
<p><b><i>Multiple comparisons</i></b></p>
<p>In the case where you find that an interaction effect is statistically significant, you can conduct multiple comparisons to see which combinations of factors A and B create different results in the response. The same ideas hold here as those for Chapter 10 on multiple comparisons, except the tests are performed on all <i>I * j </i>Interactions.</p>
<p>To perform multiple comparisons for a two-way ANOVA by using Minitab, enter your responses (data) in Column 1, your levels of Factor A in Column 2, and your levels of Factor B in Column 3. Choose Stat&gt;ANOVA&gt;General Linear Model. In the Responses box, enter your Column 1 variable. In Model, enter 1 &lt;space&gt; 2 &lt;space&gt; 1*2 (for the main effects and the interaction effect, respectively; here &lt;space&gt; means leave a space where indicated). Click on Comparisons. In Terms, enter columns 2 and 3. Check the Method you want to use for your multiple comparisons (see Chapter 10). Click OK.</p></p>
</sape_index><!--c715886456-->]]></content:encoded>
			<wfw:commentRss>http://ankar.info/2010/05/15/getting-a-little-interaction-with-two-way-anova/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rock My World: Relating Regression to ANOVA</title>
		<link>http://ankar.info/2010/05/15/rock-my-world-relating-regression-to-anova/</link>
		<comments>http://ankar.info/2010/05/15/rock-my-world-relating-regression-to-anova/#comments</comments>
		<pubDate>Sat, 15 May 2010 18:30:15 +0000</pubDate>
		<dc:creator>Анкар</dc:creator>
				<category><![CDATA[Comparing Many Means with ANOVA]]></category>

		<guid isPermaLink="false">http://ankar.info/2010/05/15/rock-my-world-relating-regression-to-anova/</guid>
		<description><![CDATA[In This Chapter ^ Relating the formulas and procedures for one-way ANOVA and regression ^ Making the connection between these two seemingly unrelated procedures You&#8217;re motoring on in your intermediate stat course, working your ^^way through regression (where you estimate Y, Using one or more X Variables — see Chapter 4). Then you hit a [...]]]></description>
			<content:encoded><![CDATA[<sape_index><p><b><i>In This Chapter</i></b></p>
<p>^ Relating the formulas and procedures for one-way ANOVA and regression ^ Making the connection between these two seemingly unrelated procedures</p>
<p>You&#8217;re motoring on in your intermediate stat course, working your ^^way through regression (where you estimate <i>Y, </i>Using one or more <i>X </i>Variables — see Chapter 4). Then you hit a new topic, ANOVA, which stands for <i>Analysis of variance </i><b>— </b>Comparing the means of several populations (see Chapter 9). That seems to be no problem. But wait a minute; now your professor starts talking about how ANOVA is related to regression — suddenly everything starts to spin out of control. How do you reconcile two techniques that appear to be as different as apples and oranges? That&#8217;s what this chapter is all about.</p>
<p>Think of this chapter as your bridge across the gap that lies between regression and ANOVA, allowing you to walk smoothly across, answering any questions that a professor may throw into your path. You don&#8217;t apply these two techniques in this chapter (you can find that information in Chapters 4 and 9). The goal of this chapter is to determine and describe the relationship between regression and ANOVA so they don&#8217;t look quite so much like an apple and an orange.</p>
<p><b><i>Seeing Regression through the Eyes of Variation</i></b></p>
<p>Every statistical model tries to explain why the different outcomes <i>(y) </i>Are what they are. It tries to figure out what factors or explanatory variables <i>(x) </i>Can help explain that variability in those y&#8217;s. In this section, you start with the</p>
<p>Y-values by themselves and see how their variability plays a central role in the regression model. This is the first step toward applying ANOVA (the analysis of <i>Variance) </i>To the regression model.</p>
<p><b><i>Verifying Variability in the y&#8217;s and looking at x to explain it</i></b></p>
<p>No matter what <i>Y </i>Variable you&#8217;re interested in predicting, you will always have variability in those y-values. If you want to predict the length of a fish, you may notice that fish have many different lengths (indicating a great deal of variability). Even if you put all the fish of the same age and species together, you still have some variability in their lengths (it will be less than before, but still there nonetheless). The first step to understanding the basic ideas of regression and ANOVA is to understand that variability in the <i>Y</i>&#8216;s is to be expected, and your job is to try to figure out what can explain most of it. This section deals with seeing and explaining variability in the y-values.</p>
<p><b><i>Seeing the variability in Internet use</i></b></p>
<p>Both regression and ANOVA work to get a handle on explaining the variability in the <i>Y </i>Variable using an <i>X </i>Variable. After you collect your data, you can find the standard deviation in the <i>Y </i>Variable to get a sense of how much the data varies within the sample. From there, you collect data on an <i>X </i>Variable and see how much it contributes to explaining that variability.</p>
<p>Suppose you notice that people spend different amounts of time on the Internet, and you want to explore why that may be. You start by taking a small sample of 20 people and record how many hours per month they spend on the Internet. The results (in hours) are 20, 20, 22, 39, 40, 19, 20, 32, 33, 29, 24, 26, 30, 46, 37, 26, 45, 15, 24, and 31. The first thing you notice about this data is the large amount of variability in it. The <i>Standard deviation </i>(average distance from the data values to their mean) of this data set is 8.93, which is quite large given the size of the numbers in the data set.</p>
<p><b><i>Finding an &quot;x-planation&quot; for Internet use</i></b></p>
<p>So you figure out that the <i>Y</i>-values (such as amount of time someone uses the Internet from the preceding section) have a great deal of variability in them. What can help explain this? Part of the variability is due to chance. But you</p>
<p>Suspect some variable is out there (call it <i>X) </i>That has some connection to the <i>Y </i>Variable, and that variable can help you make more sense out of this seemingly wide range of y-values.</p>
<p>For example, if you record the calories for five types of candy bars as 100, 200, 300, 400, and 500, you would say &quot;Wow, that&#8217;s a lot of variation in calories; I wonder why that is?&quot; Then you notice that the weights of the candy bars are 1, 2, 3, 4, and 5 ounces, respectively. This relationship can be expressed as <i>Y </i>= 100x, where <i>Y </i>Equals calories and <i>X </i>Equals weight.</p>
<p>Now you can look at what before was a bunch of variability in the y-values and say, &quot;Hey, that&#8217;s not just random variability; the differing y-values can be explained by the weight of candy bar (x).&quot; You can now use <i>X </i>In a nice regression model to estimate <i>Y. </i>Notice that you&#8217;re talking about splitting the total variability in the <i>Y</i>&#8216;s into the part due to <i>X </i>And the part due to chance (error). That&#8217;s ANOVA language! Hey, perhaps regression and ANOVA are related after all. . .</p>
<p>To continue with the Internet use example, suppose you have a brainstorm that number of years of education could possibly be related to Internet use. In this case, the explanatory variable (input variable, <i>X) </i>Is years of education, and you want to use it to try to estimate <i>Y, </i>The number of hours on the Internet in a month. You take a larger random sample of 250 Internet users and ask them how many years of education they had (so <i>N </i>= 250). You can check out the first ten observations from your data set containing the <i>(x, y) </i>Pairs in Table 12-1. If a significant connection of some sort exists between the <i>X</i>-values and the <i>Y</i>-values, then you can say that <i>X </i>Is helping to explain some of the variability in the <i>Y</i>&#8216;s. If it explains enough variability, you can place <i>X </i>Into a simple regression model and use it to estimate <i>Y.</i></p>
<table class=msonormaltable border=1 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p><b>Table 12-1</b></p>
</td>
<td>
<p><b>First Ten Observations from the Education</b></p>
</td>
</tr>
<tr>
<td>
<p><b>And Internet Use Example</b></p>
</td>
</tr>
<tr>
<td>
<p><b><i>Years of Education</i></b></p>
</td>
<td>
<p><b><i>Hours on Internet (For One Month)</i></b></p>
</td>
</tr>
<tr>
<td>
<p>15</p>
</td>
<td>
<p>41</p>
</td>
</tr>
<tr>
<td>
<p>15</p>
</td>
<td>
<p>32</p>
</td>
</tr>
<tr>
<td>
<p>11</p>
</td>
<td>
<p>33</p>
</td>
</tr>
<tr>
<td>
<p>10</p>
</td>
<td>
<p>42</p>
</td>
</tr>
<tr>
<td>
<p>10</p>
</td>
<td>
<p>28</p>
</td>
</tr>
<tr>
<td>
<p>10</p>
</td>
<td>
<p>21</p>
</td>
</tr>
</table>
<p><i>(continued)</i></p>
<table class=msonormaltable border=1 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p><b>Table 12-1 <i>(continued)</i></b></p>
</td>
</tr>
<tr>
<td>
<p><b><i>Years of Education</i></b></p>
</td>
<td>
<p><b><i>Hours on Internet (For One Month)</i></b></p>
</td>
</tr>
<tr>
<td>
<p><i>10</i></p>
</td>
<td>
<p>17</p>
</td>
</tr>
<tr>
<td>
<p>10</p>
</td>
<td>
<p>14</p>
</td>
</tr>
<tr>
<td>
<p>9 18</p>
</td>
</tr>
<tr>
<td>
<p>9</p>
</td>
<td>
<p>14</p>
</td>
</tr>
</table>
<p><b><i>Getting results with regression</i></b></p>
<p>After you have a possible <i>X </i>Variable picked, you collect pairs of data <i>(x, y) </i>On a random sample of individuals from the population, and you look for a possible linear relationship between them. To do this, use Minitab to make a scatterplot of the data and calculate the correlation <i>(r). </i>If the data appear to follow a straight line (as shown on the scatterplot), you go ahead and perform a simple linear regression of the response variable <i>Y </i>Based on the <i>X </i>Variable. The p-value of the <i>X </i>Variable in the simple linear regression analysis tells you whether or not the <i>X </i>Variable does a significant job in predicting <i>Y. </i>Some of the details of getting the regression results are described below (for full information, see Chapter 4).</p>
<p>Looking at the small snippet of 10 out of the 250 person data set in Table 12-1, you can begin to see that you may have a pattern between education and Internet use. It looks like as education increases so does Internet use.</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-111.jpg" width="62" height="60" class=""/></p>
<p>To do a simple linear regression using Minitab, enter your data in two columns: the first column for your <i>X </i>Variable and the second column for your <i>Y </i>Variable (as in Table 12-1). Go to Stat&gt;Regression&gt;Regression. Click on your <i>Y </i>Variable in the left-hand box; the <i>Y </i>Variable then appears in the Response box on the right-hand side. Click on your <i>X </i>Variable in the left-hand box; the <i>X </i>Variable then appears in the Predictor box in the right-hand side. Click OK, and your regression analysis is done. As part of every regression analysis, Minitab also provides you with the corresponding ANOVA results, found at the bottom of the output.</p>
<p>The simple linear regression output that Minitab gives you for the education and Internet example is in Figure 12-1. (Notice the ANOVA output at the bottom; you can see the connection in the upcoming section &quot;Regression and ANOVA: A Meeting of the Models.&quot;)</p>
<p><b>Figure 12-1:</b></p>
<p>Output for simple linear regression applied to education and Internet use data.</p>
<p><b>Regression Analysis: Internet versus Education</b></p>
<p>The regression equation is Internet = —8.29 + 3.15 Education</p>
<p>Predictor&nbsp;Coef SE Coef&nbsp;T P</p>
<p>Constant&nbsp;—8.290 2.665 —3.11 0.002</p>
<p>Education 3.1460 0.2387 13.18 0.000</p>
<p>S = 7.23134</p>
<p>R—Sq = 41.2%</p>
<p>R—Sq(adj) = 41.0%</p>
<p>Analysis of Variance</p>
<p>Source&nbsp;DF&nbsp;SS</p>
<p>Regression&nbsp;1&nbsp;9085.6</p>
<p>Residual Error&nbsp;248&nbsp;12968.5</p>
<p>Total&nbsp;249&nbsp;22054.0</p>
<p>MS F</p>
<p>9085.6 173.75 5 2.3</p>
<p>P</p>
<p>0.000</p>
<p>Looking at Figure 12-1, you see that the p-value on the row marked <i>Education </i>Is 0.000, which means the p-value&#8217;s less than 0.001. Therefore the relationship between years of education and Internet use is statistically significant. A scat-terplot of the data (not shown here) also indicates that the data appear to have a positive linear relationship. That means as you increase number of years of education, Internet use also tends to increase (on average).</p>
<p><b><i>Assessing the fit of the regression model</i></b></p>
<p>Before you go ahead and use a regression model to make predictions for <i>Y </i>Based on an <i>X </i>Variable, you must first assess the fit of your model. One way to get a rough idea of how well your regression model fits is by using a <i>Scatterplot </i>(a graph showing all the pairs of data plotted in the <i>X-y </i>Plane). Use the scatterplot to see whether the data appears to fall in the pattern of a line. If the data appears to follow a straight-line pattern (or even something close to that — anything but a curve or a scattering of points that has no pattern at all), you calculate the correlation, r, to see how strong the linear relationship between <i>X </i>And <i>Y </i>Is (the closer <i>R </i>Is to +1 or -1, the stronger the relationship; the closer <i>R </i>Is to zero, the weaker the relationship). Minitab can do scatterplots and correlations for you; see Chapter 4 for more on simple linear regression, including making a scatterplot and finding the value of <i>R.</i></p>
<p>If the data doesn&#8217;t have a significant correlation, stop the analysis; you can&#8217;t go further to find a line that fits a relationship that doesn&#8217;t exist.</p>
<p>Next you come to the more general way of assessing not only the fit of a simple linear regression model, but many other models too (for example: multiple, nonlinear, and logistic regression models in Chapters 5, 7, and 8, to name a few). In simple linear regression, the value of R2, as indicated by Minitab and statisticians as a capital <i>R </i>(squared), is equal to the square of the Pearson correlation coefficient, <i>R </i>(indicated by Minitab and statisticians by a small r). In all other situations, <i>R2 </i>Provides a more general measure of model fit. (Note that <i>R </i>Only measures the fit of a straight-line relationship between one <i>X </i>Variable and one <i>Y </i>Variable; see Chapter 4.) Finally, <i>R2 </i>Adjusted modifies <i>R2 </i>To account for the number of variables in the model. <i>R2 </i>Is what statisticians use to assess model fit (see Chapter 5 for more).</p>
<p>The value of <i>R2 </i>Adjusted for the model of using education to estimate Internet use (Figure 12-1) is equal to 41 percent. This value reflects the percentage of variability in Internet use that can be explained by a person&#8217;s years of education. This number isn&#8217;t great, but it&#8217;s not terrible either. Note the square root of 41 percent is 0.64 for <i>R </i>Itself, which in the case of linear regression indicates a moderate relationship.</p>
<p>This evidence gives you the green light to use the results of the regression analysis to estimate number of hours of Internet use in a month by using years of education. The regression equation as it appears in the top part of the Figure 12-1 output is Internet = -8.29 + 3.15 * 16 = 42.11. So if you have 16 years of education, for example, your estimated Internet use is 42.11, or about 42 hours per month (about 10.5 hours per week).</p>
<p>But wait! Look again at Figure 12-1 and zoom in on the bottom part. I didn&#8217;t ask for anything special to get this info on the Minitab output, but you can see an ANOVA table there. That seems like a fish out of water doesn&#8217;t it? But in the next section you see how an ANOVA table can describe regression results (albeit it in a different way).</p>
<p><b><i>Regression and ANOVA: A Meeting of the Models</i></b></p>
<p>Okay, here it comes. You&#8217;ve already broken down the regression output into all its pieces and parts. The next step toward understanding the connection between regression and ANOVA is to apply the sums of squares from ANOVA to regression (something that is typically not done in a regression analysis). Before you start, think of this process as going to a 3-D movie, where you have to wear special glasses in order to see all the special effects!</p>
<p>In this section, you see the sums of squares in ANOVA applied to regression and how the degrees of freedom work out. You build an ANOVA table for regression and discover how the <i>T-test </i>For a regression coefficient is related to the <b>F</b>-test in ANOVA. I know you can hardly wait, so I won&#8217;t keep you in suspense any longer.</p>
<p><b><i>Comparing sums of squares</i></b></p>
<p><i>Sums of squares </i>Is a term you may remember from ANOVA (see Chapter 9), but it certainly isn&#8217;t a term you normally use when talking about regression (as in Chapter 4). Yet, both types of models can be broken down into sums of squares, and that similarity gets at the true connection between ANOVA and regression. In step-by-step terms, you first partition out the variability in the <i>Y </i>Variable by using formulas for sums of squares from ANOVA (sums of squares for total, treatment, and error). Then you find those same sums of squares for regression — this is the twist on the process because you typically don&#8217;t find sums of squares for regression. You compare the two procedures through their sums of squares. This section shows you the details of how this comparison is done.</p>
<p><b><i>Partitioning Variability by using SSTO, SSE, and SST for ANOVA</i></b></p>
<p>ANOVA is all about partitioning the total variability in the <i>Y</i>-values into sums of squares (see all the info you ever need on one-way ANOVA in Chapter 9). The key idea is that SSTO = SST + SSE, where SSTO is the total variability in the <b>Y</b>-values; SST measures the variability explained by the model (also known as the treatment, or <i>X </i>Variable in this case); and SSE measures the variability due to error (what&#8217;s left over after the model is fit).</p>
<p><b>Y </b><i>- y </i><b>J </b>,</p>
<p>And <b>X </b><b>C</b><b>Y &#8211; </b><i>Y </i><i>J </i>Respectively, where <i>Y </i>Is the mean of the <b>Y</b>&#8216;s, <i>Yt </i>Is each observed</p>
<p>Value of <b>Y, </b>And <b>Y </b>Is each predicted value of <i>Y </i>From the ANOVA model. Use these formulas to calculate the sums of squares for ANOVA (Minitab does this for you when it performs ANOVA). Keep these values of SSTO, SST, and SSE. You will use them to compare to the results from regression.</p>
<p><b><i>Finding sums of squares for regression</i></b></p>
<p>In regression, you measure the deviations in the <b>Y</b>-values by taking each <i>Yt </i>Minus its mean, <i>Y</i>. Square each result and add them all up, and you have SSTO. Next, take the residuals, which represent the difference between each <i>Yt </i>And it&#8217;s estimated value from the model, <i>Y</i>. Square the residuals and add them up, and you get the formula for SSE.</p>
<p>Now that you have calculated SSTO and SSE, you need the bridge between them. That is, you need a formula that connects the variability in the y&#8217;s (SSTO) and the variability in the residuals after fitting the regression line (SSE). That bridge is SSR (equivalent to SST in ANOVA). In regression, y represents the predicted value of yi based on the regression model. These are the values on the regression line. To assess how much this regression line helps to predict the <i>Y</i>-values, you compare it to the model you would get without any <i>X </i>Variable in it.</p>
<p>Without any other information, the only thing you can do to predict <i>Y </i>Is look at the average, <i>Y</i>. So, SST compares the predicted value from the regression line to the predicted value from the flat line (the mean of the y&#8217;s) by subtract -</p>
<p>Ing them. The result is <b>Y</b>Y _<i>Y </i><b>)</b>. Square each result and sum them all up, and you get the formula for SST.</p>
<p>Now for one last hoop to jump through (as if you haven&#8217;t had enough already). Instead of calling the sum of squares for the regression model SST as is done in ANOVA, statisticians call it <i>SSR </i>For <i>Sum of squares regression. </i>Consider SSR from regression to be equivalent to the SST from ANOVA. The reason this is important is because computer output lists the sums of squares for the regression model as SSR not SST.</p>
<p>To summarize the sums of squares as they apply to regression, you have SSTO = SSR + SSE where</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-112.jpg" width="52" height="63" class=""/></p>
<p>SSTO measures the variability in the observed y-values around their mean. This value represents the variance of the <i>Y</i>-values.</p>
<p>SSE represents the variability between the predicted values for <i>Y </i>(the values on the line) and the observed <i>Y</i>-values. SSE represents the variability left over after the line has been fit to the data.</p>
<p>SSR measures the variability in the predicted values for <i>Y </i>(the values on the line) from the mean of <i>Y. </i>SSR is the sum of squares due to the regression model (the line) itself.</p>
<p>Minitab calculates all the sums of squares for you as part of the regression analysis. You can see this calculation in the section &quot;Bringing regression to the ANOVA table.&quot;</p>
<p><b><i>Dividing up the degrees of freedom</i></b></p>
<p>In ANOVA, you test a model for the treatment (population) means by using an</p>
<p>F-test, which is <i>F = MST</i>. To get MST (the mean sum of squares for treatment),</p>
<p><i>MSE </i><b>»&nbsp;v </b><b><i>Ji</i></b></p>
<p>You take SST (the sum of squares for treatment) and divide by its degrees of</p>
<p>Freedom. You do the same with MSE (that is, take SSE, the sum of squares for error, and divide by its degrees of freedom). The question now is, what do those degrees of freedom represent and how do they relate to regression? This section addresses that issue.</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-113.jpg" width="52" height="63" class=""/></p>
<p><b><i>Degrees of freedom in ANOVA</i></b></p>
<p>In ANOVA, the degrees of freedom for SSTO is <i>N </i>- 1, which represents the sample size minus one. In the formula for SSTO, <b>X </b><b>_</b><i>Yt &#8211; y)</i>, you see there are <i>N </i>Observed <b>Y</b>-values minus one mean. That in a very general way is where the <i>N </i>- 1 comes from.</p>
<p><b>X </b><b>_ </b><b>Y </b><i>- y </i><b>)</b><i>2</i></p>
<p>Note that if you divide SSTO by <i>N </i>- 1, you get <b>—1-s-^-, </b>The variance in the</p>
<p><i>N</i>-1</p>
<p><i>Y</i>-values. This calculation makes good sense because the variance also measures the total variability in the <i>Y</i>-values.</p>
<p>The degrees of freedom for SSE is <i>N </i>- <i>K. </i>In the formula for SSE, <b>X </b><i>Y </i><i>Y &#8211; y </i><i>J </i>,</p>
<p>You see there are <i>N </i>Observed <b>Y</b>-values, and <i>K </i>Is the number of treatments in the model. In regression, the number of coefficients in the model is <i>K </i>= 2 (the slope and the <i>Y</i>-intercept). So you have degrees of freedom <i>N </i>- 2 associated with SSE when you&#8217;re doing regression.</p>
<p><b><i>Degrees of freedom in regression</i></b></p>
<p>The degrees of freedom for SST in ANOVA equals the number of treatments minus one. How does the degrees of freedom idea relate to regression? The number of treatments in regression is equivalent to the number of parameters in a model (a parameter being an unknown constant in the model that you&#8217;re trying to estimate).</p>
<p>When you test a model you&#8217;re always comparing it to a different (simpler) model to see whether it fits the data better. In linear regression you compare your regression line <i>Y </i>= <b>B0 </b>+ <i>B1x, </i>To the horizontal line <i>Y </i>= <i>Y</i>. This second, simpler model just uses the mean of <i>Y </i>To predict <i>Y </i>All the time, no matter what <i>X </i>Is. In the regression line, you have two coefficients: one to estimate the parameter for the <b>Y</b>-intercept <i>(b0) </i>And one to estimate the parameter for slope <i>(b1) </i>In the model. In the second, simpler model, you have only one parameter: the value of the mean. The degrees of freedom for SSR in simple linear regression is the difference in the parameters of the two models: 2 &#8211; 1 = 1.</p>
<p>Putting all this together, the degrees of freedom for regression must add up for the equation SSTO = SSR + SSE. The degrees of freedom corresponding to this equation are <i>(n </i>- 1) = (2 &#8211; 1) + <i>(n </i>- 2), which is true if you do the math. So the degrees of freedom for regression, using the ANOVA approach, all check out. Whew!</p>
<p>In Figure 12-1, you can see the degrees of freedom for each sums of squares listed under the <i>DF </i>Column of the ANOVA part of the output. You see SSR has 2 &#8211; 1 = 1 degree of freedom, SSE has 250 &#8211; 2 = 248 degrees of freedom (because <i>N </i>= 250 observations were in the data set and <i>K </i>= 2 and you find <i>N </i>- <i>K </i>To get degrees of freedom for SSE). The degrees of freedom for SSTO is 250 &#8211; 1 = 249.</p>
<p><b><i>Bringing regression to the ANOVA table</i></b></p>
<p>In ANOVA, you test your model Ho: All <i>K </i>Population means are equal versus Ha: At least two population means are different by using a F-test. You build your F-test statistic by relating the sums of squares for treatment to the sum of squares for error. To do this, you divide SSE and SST by their degrees of freedom (n &#8211; <i>K </i>And <i>K </i>- 1, respectively, where <i>N </i>Is the sample size and <i>K </i>Is the number of treatments) to get the mean sums of squares for error (MSE) and mean sums of squares for treatment (MST). In general, you want MST to be large compared to MSE, which would indicate that the model fits well. The results of all these statistical gymnastics are summarized by Minitab in a table called (cleverly) the ANOVA table.</p>
<p>The ANOVA table shown in the bottom part of Figure 12-1 for the Internet-use data represents the ANOVA table you get from using the regression line as your model. Under the Source column, you may be used to seeing treatment, error, and total. For regression, the treatment is the regression line, so you see <i>Regression </i>Instead of treatment. The error term in ANOVA is labeled <i>Residual error, </i>Because in regression, you measure error in terms of residuals. Finally you see <i>Total, </i>Which is the same the world around.</p>
<p>The SS column represents the sums of squares for the regression model. The three sums of squares listed in the SS column are SSR (for regression), SSE (for residuals), and SST (total). These sums of squares are calculated using the formulas from the previous section; the degrees of freedom, <i>DF </i>In the table, are found by using the formulas from the previous section also.</p>
<p>The MS column takes the value of SS &quot;whatever&quot;(you fill in the blank) and divides it by the respective degrees of freedom, just like ANOVA. For example in Figure 12-1, SSE is 12,968.5, and the degrees of freedom is 248. Take the first value divided by the second one to get 52.29 or 52.3, which is listed in the ANOVA table for MSE.</p>
<p>The value of the F-statistic, using the ANOVA method, is <i>F = </i><b><i>^j</i></b><i>SE</i><i> = </i>9&#8217;52 3&#8217;6 =</p>
<p>173.7 in the Internet example, which you can see in column five of the ANOVA part of Figure 12-1 (subject to rounding). The F-statistics&#8217;s p-value is calculated based on an <i>F</i>-distribution with 2 &#8211; 1 = 1 and 250 &#8211; 2 = 248 degrees of</p>
<p>Freedom, respectively. (In the Internet example, the p-value listed in the last column of the ANOVA table is 0.000, meaning the regression model fits.) But remember, in regression you don&#8217;t use an F-statistic and an F-test. You use a /-statistic and a /-test. What gives? The next section explains.</p>
<p><b><i>Relating the F &#8211; and t-statistics: The final frontier</i></b></p>
<p>In regression, one way of testing whether the best-fitting line is statistically significant is to test Ho: slope = 0 versus Ha: slope ^ 0. To do this, you use a /-test (see Chapter 3). The slope is the heart and soul of the regression line, because it describes the main part of the relationship between <i>X </i>And y. If the slope of the line equals zero (you can&#8217;t reject Ho), you&#8217;re just left with <i>Y </i>= <i>B1, </i>A horizontal line, and your model <i>Y </i>= <i>B0 + b1x </i>Isn&#8217;t doing anything for you.</p>
<p>In ANOVA, you test to see whether the model fits by testing Ho: The means of the populations are all equal, versus Ha: At least two of the population means aren&#8217;t equal. To do this you use an F-test (taking MST and dividing it by MSE; see Chapter 10).</p>
<p>The sets of hypotheses in regression and ANOVA seem totally different, but in essence, they&#8217;re both doing the same general thing: testing whether a certain model fits. In the regression case, the model you want to see fit is the straight line, and in the ANOVA case, the model of interest is a set of (normally distributed) populations with at least two different means (and the same variance). Here each population is labeled as a treatment by ANOVA.</p>
<p>But more than that, you can think of it this way: Suppose you took all the populations from the ANOVA and lined them up side by side on an <i>X-y </i>Plane (see Figure 12-2). If the means of those distributions are all connected by a flat line (representing the mean of the <i>Y</i>&#8216;s), then you would have no evidence against Ho in the F-test, so you can&#8217;t reject it — your model isn&#8217;t doing anything for you (it doesn&#8217;t fit). This idea is similar to the idea of fitting a flat horizontal line through the <i>Y</i>-values in regression; a straight-line model with a nonzero slope doesn&#8217;t work in that case.</p>
<p>The big thing is that statisticians can prove (so you don&#8217;t have to) that an F-statistic is equivalent to the square of a /-statistic, and the F-distribution is equivalent to the square of a /-distribution when the SSR has df = 2 &#8211; 1 = 1. And when you have a simple linear regression model, the degrees of freedom is exactly one! (Note that <i>F </i>Is always greater than or equal to zero, which is needed if you&#8217;re making it the square of something.) So there you have it! The /-statistic for testing the regression model is equivalent to an <i>F</i>-statistic for ANOVA when the ANOVA table is formed for the simple regression model.</p>
<p><b>Figure 12-2:</b></p>
<p>Connecting means of populations to the slope of a line.</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-114.png" width="179" height="160" class=""/></p>
<p>Indeed (the stat professor&#8217;s way of saying &quot;and this is the <i>Really </i>Cool part. . .&quot;), if you look at the value of the /-statistic for testing the slope of the education variable in Figure 12-1, you see that it&#8217;s 13.18 (look at the row marked <i>Education </i>And the column marked T). Square that value, and you get 173.71. The F-statistic in the ANOVA table of Figure 12-1 is equal to 173.75. The F-statistic from ANOVA and the t-statistic from regression are equal to each other in Figure 12-2, subject to a little round-off error done by Minitab on the output. (Just like magic! I still get chills just thinking about it.)</p>
</sape_index><!--c715886456-->]]></content:encoded>
			<wfw:commentRss>http://ankar.info/2010/05/15/rock-my-world-relating-regression-to-anova/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Going One-Way with Analysis of Variance</title>
		<link>http://ankar.info/2010/05/15/going-one-way-with-analysis-of-variance/</link>
		<comments>http://ankar.info/2010/05/15/going-one-way-with-analysis-of-variance/#comments</comments>
		<pubDate>Sat, 15 May 2010 18:30:15 +0000</pubDate>
		<dc:creator>Анкар</dc:creator>
				<category><![CDATA[Comparing Many Means with ANOVA]]></category>

		<guid isPermaLink="false">http://ankar.info/2010/05/15/going-one-way-with-analysis-of-variance/</guid>
		<description><![CDATA[In This Chapter ^ Extending the /-test for comparing two means by using ANOVA ^ Discovering and utilizing the ANOVA process ^ Carrying out an F-test ^ Navigating the ANOVA table Ne of the most commonly used statistical techniques at the intermediate level is Analysis of variance (affectionately known as ANOVA). Because the name has [...]]]></description>
			<content:encoded><![CDATA[<sape_index><p><b><i>In This Chapter</i></b></p>
<p>^ Extending the /-test for comparing two means by using ANOVA</p>
<p>^ Discovering and utilizing the ANOVA process</p>
<p>^ Carrying out an F-test</p>
<p>^ Navigating the ANOVA table</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-87.jpg" width="28" height="39" class=""/></p>
<p>Ne of the most commonly used statistical techniques at the intermediate level is <i>Analysis of variance </i>(affectionately known as ANOVA).</p>
<p>Because the name has the word variance in it, you may think that this technique has something to do with <i>Variance </i>— and you would be right. Analysis of variance is all about examining the amount of variability in a <i>Y </i>(response) variable and trying to understand where that variability is coming from.</p>
<p>One way that you can use ANOVA is to compare several populations regarding some quantitative variable, <i>Y. </i>The populations you want to compare constitute different groups (denoted by an <i>X </i>Variable), such as political affiliations, age groups, or different brands of a product. ANOVA is also particularly suitable for situations involving an experiment where you apply certain treatments <i>(x) </i>To subjects, and you measure a response <i>(y).</i></p>
<p>In this chapter, you start with the /-test for two population means, the precursor to ANOVA. Then you move on to the basic concepts of ANOVA: sums of squares, the F-test, and the ANOVA table. You apply these basics to the one-factor or one-way ANOVA, where you compare the responses based only on one treatment variable. (In Chapter 11, you can see them applied to a two-way ANOVA, which has two treatment variables.)</p>
<p><b><i>Comparing Two Means with a t-Test</i></b></p>
<p>The <i>Two sample t-test </i>Is designed to test to see whether two population means are different. The conditions for the two sample t-test are the following:</p>
<p>*e The two populations are independent (in other words, their outcomes don&#8217;t affect each other).</p>
<p>*e The response variable <i>(y) </i>Is a quantitative variable (meaning that its values represent counts or measurements).</p>
<p>*e The y-values for each population have a normal distribution (however, their means may be different; that is what the t-test determines).</p>
<p>*e The variances of the two normal distributions are equal.</p>
<p>For large sample sizes when you know the variances, you use a Z-test for the two population means. However, a t-test allows you to test two population means when the variances are unknown or the sample sizes are small. This occurs quite often in situations where an experiment is performed and the number of subjects is limited.</p>
<p>Although you have seen t-tests before in your intro stats class, it may be good to review the main ideas. The t-test tests the hypotheses Ho: <i>U\ </i>= |u2 versus Ha: <i>Ui </i>Is &lt;, &gt;, or ^u,2, where the situation dictates which of these hypotheses you use. (Just a note that with ANOVA, you extend this idea to <i>K </i>Different means from <i>K </i>Different populations, and the only version of Ha of interest is ^.)</p>
<p>To conduct the two sample <i>T</i>-test, you collect two data sets from the two populations, using two independent samples. To form the test statistic (the <i>T</i>-statistic), you subtract the two sample means and divide by the standard error (a combination of the two standard deviations from the two samples and their sample sizes). You compare the t-statistic to the t-distribution with ni + n2 &#8211; 2 degrees of freedom and find the p-value.</p>
<p>If the p-value is less than the prespecified a level, say 0.05, you have enough evidence to say the population means are different. (For information on hypothesis tests, see Chapter 3.)</p>
<p>For example, suppose you&#8217;re at a watermelon seed spitting contest where contestants each put watermelon seeds in their mouths and spit them as far as they can. Results are measured in inches and are treated with the reverence of the shot-put results at the Olympics. You want to compare the watermelon seed spitting distances of female and male adults. Your data set includes ten people from each group.</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-88.jpg" width="52" height="63" class=""/></p>
<p>You can see the results of the <i>T-test </i>In Figure 9-1. The mean spitting distance for females was 47.8 inches; the mean for males was 56.5 inches. The t-statistic for the difference in the two means (females &#8211; males) is <i>T </i>= -2.23, which has a p-value of 0.039 (see last line of Figure 9-1 output). At a level of a = 0.05, this difference is significant (because 0.039 &lt; 0.05). You conclude that males and females differ with respect to their mean watermelon seed spitting distance. And you can say males are likely spitting farther because their sample mean was higher.</p>
<p><b>Figure 9-1:</b></p>
<p>A f-test comparing mean watermelon seed spitting distances for females versus males.</p>
<p>Two-sample T for females vs males</p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>N</p>
</td>
<td>
<p>Mean</p>
</td>
<td>
<p>StDev</p>
</td>
<td>
<p>SE Mean</p>
</td>
</tr>
<tr>
<td>
<p>Females</p>
</td>
<td>
<p>10</p>
</td>
<td>
<p>47.80</p>
</td>
<td>
<p>9.02</p>
</td>
<td>
<p>2.9</p>
</td>
</tr>
<tr>
<td>
<p>Males</p>
</td>
<td>
<p>10</p>
</td>
<td>
<p>5 6.50</p>
</td>
<td>
<p>8.45</p>
</td>
<td>
<p>2.7</p>
</td>
</tr>
<tr>
<td>
<p>Difference</p>
</td>
<td>
<p>= mu</p>
</td>
<td>
<p>(females)</p>
</td>
<td>
<p>- mu</p>
</td>
<td>
<p>(males)</p>
</td>
</tr>
</table>
<p>Estimate for difference: -8.70000</p>
<p>95% CI for difference: (-16.90914, -0.49086)</p>
<p>T-Test of difference = 0 (vs not =): T-Value = -2.23 P-Value</p>
<p>= 0.039 DF = 18</p>
<p><b><i>Evaluating More Means with ANOVA</i></b></p>
<p>Now that you can compare two independent populations inside and out, at some point two populations will not be enough. Suppose you want to compare more than two populations regarding some response variable <i>(y). </i>This idea kicks the t-test up a notch into the territory of ANOVA. The ANOVA procedure is built around a hypothesis test called the <i>F-test, </i>Which compares how much the groups differ from each other, compared to how much variability is in each group. In this section, I set up an example of when to use ANOVA and show you the steps involved in the ANOVA process. You can then apply the ANOVA steps to the following example throughout the rest of the chapter.</p>
<p><b><i>Spitting seeds: A situation just waiting for ANOVA</i></b></p>
<p>Before you can jump into using ANOVA, you must figure out what question you want answered and collect the necessary data.</p>
<p>Suppose you want to compare the watermelon seed spitting distances for four different age groups: 6-8, 9-11, 12-14, and 15-17. The hypotheses for this example are Ho: <i>\i1 = </i>U,2 = u,3 = u,4 versus Ha: At least two of these means</p>
<p>Are different, where the population means u, represent those from the age groups, respectively. Over the years of this contest, you have collected data on 200 children from each age group, so you have some prior ideas about what the distances typically look like. This year, you have 20 entrants, 5 in each age group. You can see the data from this year, in inches, in Table 9-1.</p>
<table class=msonormaltable border=1 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p><b>Table 9-1</b></p>
</td>
<td>
<p><b>Watermelon Seed Spitting Distances for Four Child Age Groups (Measured in Inches)</b></p>
</td>
</tr>
<tr>
<td>
<p><b><i>6-8 Years</i></b></p>
</td>
<td>
<p><b><i>9-11 Years</i></b></p>
</td>
<td>
<p><b><i>12-14 Years</i></b></p>
</td>
<td>
<p><b><i>15-17 Years</i></b></p>
</td>
</tr>
<tr>
<td>
<p>38</p>
</td>
<td>
<p>38</p>
</td>
<td>
<p>44</p>
</td>
<td>
<p>44</p>
</td>
</tr>
<tr>
<td>
<p>39</p>
</td>
<td>
<p>39</p>
</td>
<td>
<p>43</p>
</td>
<td>
<p>47</p>
</td>
</tr>
<tr>
<td>
<p>42</p>
</td>
<td>
<p>40</p>
</td>
<td>
<p>40</p>
</td>
<td>
<p>45</p>
</td>
</tr>
<tr>
<td>
<p>40</p>
</td>
<td>
<p>44</p>
</td>
<td>
<p>44</p>
</td>
<td>
<p>45</p>
</td>
</tr>
<tr>
<td>
<p>41</p>
</td>
<td>
<p>43</p>
</td>
<td>
<p>45</p>
</td>
<td>
<p>46</p>
</td>
</tr>
</table>
<p>Do you think you see a difference in distances for these age groups based on this data? If you just combined all the data, you would see quite a bit of difference (the range of the combined data goes from 38 inches to 47 inches). Perhaps accounting for which age groups each contestant is in does explain at least some of what&#8217;s going on. But don&#8217;t stop there. In the next section, you see the official steps you need to do to answer your question.</p>
<p><b><i>4</i></b></p>
<p><b><i>Walking through the steps of ANOVA</i></b></p>
<p>You have decided on the quantitative response variable <i>(y) </i>You want to compare for your <i>K </i>Various population (or treatment) means, and you collected a random sample of data from each population. Now you&#8217;re ready to conduct ANOVA on your data to see whether the population means are different for your response variable, <i>Y.</i></p>
<p>The characteristic that defines these populations is called the <i>Treatment variable, x. </i>Statisticians use the word <i>Treatment </i>In this context because one of the biggest uses of ANOVA is for designed experiments where subjects are randomly assigned to treatments, and the responses are compared for the various treatment groups. So statisticians oftentimes use the word <i>Treatment </i>Even when the study isn&#8217;t an experiment, and they&#8217;re comparing regular populations. Hey, don&#8217;t blame me! I&#8217;m just following the proper statistical terminology.</p>
<p>Just to get a feeling for what an ANOVA procedure involves and to give you a quick reference for a later time, here are the general steps in a one-way ANOVA:</p>
<p><b>1.&nbsp;Check the ANOVA conditions, using the data collected from each of the </b><b><i>K </i></b><b>Populations.</b></p>
<p>See the next section, &quot;Checking the conditions,&quot; for the specifics on these conditions.</p>
<p><b>2.&nbsp;Set up the hypotheses Ho: </b><i>\i1 </i><b>= </b>U,2 <b>=. . . = </b>Uk <b>Versus Ha: At least two of the population means are different.</b></p>
<p>Another way to state your alternative hypothesis is by saying Ha: At least two of U2, .. . <i>U* </i>Are different.</p>
<p><b>3.&nbsp;Collect data from </b><b><i>K </i></b><b>Random samples, one from each population.</b></p>
<p><b>4.&nbsp;Conduct an F-test on the data from step three, using the hypotheses from step two, and find the p-value.</b></p>
<p>See the section &quot;Doing the F-test&quot; later in this chapter for these instructions.</p>
<p><b>5.&nbsp;Make your conclusions: If you reject Ho (when your p-value is less than 0.05 or your prespecified </b>A <b>Level), you conclude that at least two of the population means are different; otherwise, you conclude that you didn&#8217;t have enough evidence to reject Ho (you can&#8217;t say the means are different).</b></p>
<p>If these steps look like a foreign language to you, don&#8217;t fear — I describe each of these steps in detail in the sections to follow.</p>
<p><b><i>Checking the Conditions</i></b></p>
<p>Step one of ANOVA is checking to be sure all necessary conditions are met before diving into the data analysis. The conditions for using ANOVA are just an extension of the conditions for a /-test (see the section &quot;Comparing Two Means with a /-Test&quot;). The following conditions all need to hold in order for ANOVA to be conducted:</p>
<p>The <i>K </i>Populations are independent (in other words, their outcomes don&#8217;t affect each other).</p>
<p>The <i>K </i>Populations each have a normal distribution. The variances of the <i>K </i>Normal distributions are equal.</p>
<p>I go into more detail about these conditions in the following sections.</p>
<p><b><i>Checking off independence</i></b></p>
<p>To check the first condition, examine how the data was collected from each of the separate populations. In order to maintain independence, the outcomes from one population can&#8217;t affect the outcomes of the other populations. If the data has been collected by using a separate random sample from each population <i>(random </i>Here meaning that each individual in the population had an equal chance of being selected), this factor ensures independence at the strongest level.</p>
<p>In the watermelon seed spitting data (see Table 9-1), the data aren&#8217;t randomly sampled from each age group because the data represents everyone who participated in the contest. But, you can argue that the seed spitting distances from one age group don&#8217;t affect the seed spitting distances from the other age groups, so the independence assumption is okay here also.</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-89.jpg" width="62" height="61" class=""/></p>
<p><b><i>Looking for what&#8217;s normal</i></b></p>
<p>The second ANOVA condition is that each of the <i>K </i>Populations has a normal distribution. To check this condition, make a separate histogram of the data from each group and see whether it resembles a normal distribution. Data from a normal distribution should look symmetric (in other words, if you split the histogram down the middle, it looks the same on each side) and have a bell-shape. Don&#8217;t expect the data in each histogram to follow a normal distribution exactly (remember it&#8217;s only a sample), but it shouldn&#8217;t be extremely different from a normal, bell-shaped distribution.</p>
<p>Since the data contains only five children per age group, checking conditions can be iffy. But in this case, you have past data for 200 children in each age group, so you can use that to check the conditions. The histograms and descriptive statistics of the seed spitting data for the four age groups are shown in Figure 9-2, all in one panel, so you can easily compare them to each other on the same scale. Looking at the four histograms in Figure 9-2, you can see that each graph resembles a bell shape; the normality condition isn&#8217;t being violated here. (Red flags should come up if you see two peaks in the data, or a skewed shape where the peak is off to one side, or if the histogram is flat, for example.)</p>
<p>You can use Minitab to make histograms for each of your samples and have all of them appear on one large panel, all using the same scale. To do this, go to Graph&gt;Histogram and click OK. Choose the variables that represent data from each sample by highlighting them in the left-hand box and clicking Select. Then click on Multiple Graphs, and a new window opens. Under the Show Graph Variables option, check the following box: In separate panels of the same graph. On the Same Scales for Graphs option, check the box for <i>X </i>And the box for <i>Y. </i>This option gives you the same scale on both the <i>X </i>And <i>Y </i>Axes for all the histograms. Then click OK.</p>
<p><b>Figure 9-2:</b></p>
<p>Checking ANOVA conditions by using histograms and</p>
<p>Descriptive statistics.</p>
<p><b>Histogram of Age Group 1, Age Group 2, Age Group 3, Age Group 4</b></p>
<p>36 39 42 45 48 51</p>
<p><u>Age Group 1</u></p>
<p>J]</p>
<p><b>M.</b></p>
<p>Age Group 3</p>
<p><b>—i</b><b>—</b>R <b>I—</b><b>I</b><b>—T</b><b>-L=—,-</b></p>
<p>36 39 42 45 48 51</p>
<p><b>_i_i_i_i_i_</b></p>
<p>Age Group 2</p>
<p>Age Group 4</p>
<p>EL</p>
<p>20</p>
<p>15</p>
<p>10</p>
<p>5</p>
<p>0</p>
<p><b>Descriptive Statistics: Age Group 1, Age Group 2, Age Group 3, Age Group 4</b></p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>Total</p>
</td>
</tr>
<tr>
<td>
<p>Variable</p>
</td>
<td>
<p>Count</p>
</td>
<td>
<p>Mean</p>
</td>
<td>
<p>Variance</p>
</td>
</tr>
<tr>
<td>
<p>Age</p>
</td>
<td>
<p>Group</p>
</td>
<td>
<p>1</p>
</td>
<td>
<p>2 00</p>
</td>
<td>
<p>40.116</p>
</td>
<td>
<p>4.256</p>
</td>
</tr>
<tr>
<td>
<p>Age</p>
</td>
<td>
<p>Group</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>2 00</p>
</td>
<td>
<p>41.880</p>
</td>
<td>
<p>4.994</p>
</td>
</tr>
<tr>
<td>
<p>Age</p>
</td>
<td>
<p>Group</p>
</td>
<td>
<p>3</p>
</td>
<td>
<p>2 00</p>
</td>
<td>
<p>44.165</p>
</td>
<td>
<p>3.249</p>
</td>
</tr>
<tr>
<td>
<p>Age</p>
</td>
<td>
<p>Group</p>
</td>
<td>
<p>4</p>
</td>
<td>
<p>2 00</p>
</td>
<td>
<p>47.405</p>
</td>
<td>
<p>5.154</p>
</td>
</tr>
</table>
<p><b><i>Taking note of spread</i></b></p>
<p>The third condition for ANOVA is that the variance in each of the <i>K </i>Populations is the same. To check this out on your data, use Minitab to find the variance in each sample and compare them. The variances for each sample should be close. What does <i>Close </i>Mean? A hypothesis test can handle this question; however, it falls outside the scope of most intermediate statistics courses. So you are left with a judgment call. Compare all the variances as a group and look for any glaring differences. If a difference is large enough for you to write home about (say 10 percent or more), this variance indicates a problem. (Not only do you have a problem with the ANOVA conditions, but if you&#8217;re writing your mom about your stats problems you might need to get a bit of a life.) If no big differences exist in the variances, you can say that the equal variance condition is met. The variances for the seed spitting data are shown in Figure 9-2 for each age group. They are quite close, so this condition is met.</p>
<p>To find descriptive statistics for each sample, go to Stat&gt;Basic Statistics&gt; Display Descriptive Statistics. Click on each variable in the left-hand box for which you want the descriptive statistics and then click Select. Click on the Statistics option, and a new window appears with tons of different types of statistics. Click on the ones you want and click off the ones you don&#8217;t want. Click OK. Then click OK again. Your descriptive statistics are calculated.</p>
<p>Note that you don&#8217;t need the sample sizes in each group to be equal to carry out ANOVA; however, in intermediate stats, you&#8217;ll typically see what statisticians call a <i>Balanced design, </i>Where each sample from each population has the same sample size. (For more precision in your data, the larger the sample sizes, the better; see Chapter 3.)</p>
<p><b><i>Setting Up the Hypotheses</i></b></p>
<p>Step two of ANOVA is setting up the hypotheses to be tested. You&#8217;re testing to see whether or not all the population means can be deemed equal to each other. The null hypothesis for ANOVA is that all the population means are equal. That is, Ho: u, i = u,2 =. . . = Uk, where <i>\i1 </i>Is the mean of the first population, u,2 is the mean of the second population, and so on until you reach u, k (the mean of the <i>Kth </i>Population).</p>
<p>Now what appears in the alternative hypothesis (Ha) must be the opposite of what is in the null hypothesis (Ho). What&#8217;s the opposite of having all <i>K </i>Of the population&#8217;s means equal to each other? You may think the opposite is that they&#8217;re all different. But that&#8217;s not the case. In order to blow Ho wide open, all you need is for at least two of those means to not be equal. The alternative hypothesis, Ha, is that at least two of the population means are different from each other. That is, Ha: At least two of U2, . .. <i>Uk </i>Are different.</p>
<p>Note that Ho and Ha for ANOVA are an extension of the hypotheses for a two sample f-test (which only compares two independent populations). And while the alternative hypothesis in a f-test may be that one mean is greater than, less than, or not equal to the other, you don&#8217;t consider any alternative other than ^ in ANOVA. You only want to know whether or not the means are equal — at this stage of the game anyway. After you reach the conclusion that Ho is rejected in ANOVA, you can proceed to figure out how the means are different, which ones are bigger than others, and so on, using multiple comparisons. Those details appear in Chapter 10.</p>
<p><b><i>Doing the F-Test</i></b></p>
<p>Step three, collecting the data, includes taking <i>K </i>Random samples, one from each population. Step four of ANOVA is doing the F-test on this data, which is</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-90.jpg" width="63" height="164" class=""/><img src="/wp-content/uploads/intermediate statistics for dummies-91.jpg" width="47" height="27" class=""/></p>
<p>The heart of the ANOVA procedure. This test is the actual hypothesis test of Ho: <b>U</b>4 = <b>U,2 </b>=. . . = <i>\ik </i>Versus Ha: At least two of <b>U,1, u,2, </b>. . . <i>\ik </i>Are different.</p>
<p>You have to carry out three major steps in order to complete the F-test (don&#8217;t get these steps confused with the main ANOVA steps; consider the F-test a few steps within a step):</p>
<p><b>1.&nbsp;Break down the variance of </b><b><i>Y </i></b><b>Into sums of squares.</b></p>
<p><b>2.&nbsp;Find the mean sums of squares.</b></p>
<p><b>3.&nbsp;Put the mean sums of squares together to form the F-statistic.</b></p>
<p>I describe each step of the F-test in detail and apply it to the example of comparing watermelon seed spitting distances (see Table 9-1) in the following sections.</p>
<p>Because data analysts rely heavily on computer software to conduct each step of the F-test, you can do the same. All computer software packages organize and summarize the important information from the F-test into a table format for you. This table of results for ANOVA is called (what else?) the <i>ANOVA table. </i>Because the ANOVA table is a critical part of the entire ANOVA process, I start the following sections out by describing how to run ANOVA in Minitab to get the ANOVA table, and I continue to reference this section as I describe each step of the ANOVA process.</p>
<p><b>Stacked data </b>Means that you enter all the data into two columns. Column one includes the number indicating what sample the data value is from (1 to k), and the responses <i>(y) </i>Are in column two. To analyze this data, go to Stat&gt;ANOVA&gt;One-Way Stacked. Highlight the response <i>(y) </i>Variable and click Select. Highlight the factor (population) variable and click Select. Click OK.</p>
<p><b>Unstacked </b>Is the other method of entering data: a separate column for the data in each sample. To analyze the data entered this way, go to Stat&gt;ANOVA&gt;One-Way Unstacked. Highlight the names of the columns where your data are located. Click OK.</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-92.jpg" width="63" height="60" class=""/></p>
<p><b><i>Running ANOVA in Minitab</i></b></p>
<p>Using Minitab to run ANOVA, you first have to enter the data from the k samples. You can enter the data one in of two ways:</p>
<p>I typically use the unstacked version just because I think it helps visualize the data. However, the choice is up to you, and the results come out the same no matter which one you choose.</p>
<p><b><i>Breaking down the Variance into sums of squares</i></b></p>
<p>The first step of the F-test is splitting up the variability in the <i>Y </i>Variable into portions that define where the variability is coming from. The term <i>Analysis of variance </i>Is a great description for exactly how you conduct a test of <i>K </i>Population means. With the overall goal of testing whether <i>K </i>Population (or treatment) means are equal, you take a random sample from each of the <i>K </i>Populations. You first put all the data together into one big group and measure how much total variability there is; this variability is called the <i>Sums of squares total, </i>Or SSTO. If the data are really diverse, SSTO is large. If the data are very similar, SSTO is small.</p>
<p>Now the total variability in the combined data set (SSTO) can be split into two parts:</p>
<p><b>SST: </b>The variability between the groups, known as the sums of squares for treatment</p>
<p><b>SSE: </b>The variability within the groups, known as the sum of squares for error</p>
<p>This splitting up of the variability in your data results in one of the most important equalities in ANOVA. That equality is SSTO = SST + SSE.</p>
<p>IBE# The formula for SSTO is the numerator of the formula for s2, the variance of a single data set, so SSTO = EE <b>(</b><i>Xv &#8211; x </i><i>J </i>, where <i>I </i>And <i>J </i>Represent the <i>J</i>Th value in the sample from the <i>I </i>Th population. SSTO represents the total squared distance between the data values and their overall mean. The formula for SST is SST = <i>Nt </i>E (<i>Xi &#8211; x) </i>, where ni is the size of the sample coming from the <i>I</i>Th population. SST represents the total squared distance between the means from 2 each sample and the overall mean. The formula for SSE is SSE = EE <b>(</b><i>Xv &#8211; xi</i><b>J </b>, where <i>X<b>Ij </b></i>Is the <i>J</i>Th value in the sample from the <i>I</i>Th population and <i>Xi </i>Is the mean of the sample coming from the <i>I </i>Th population. This formula represents the total squared distance between the values in each sample and their corresponding sample means. Using algebra, you can show (with some serious elbow grease) that SSTO = SST + SSE.</p>
<p>The Minitab output for the watermelon seed spitting contest for the four age groups is shown in Figure 9-3. Under the Source column of the ANOVA table, you see <i>Factor </i>Listed in row one. The factor variable (as described by Minitab) represents the treatment or population variable. In column three of the Factor row, you see the SST, which is equal to 89.75. In the Error row (row two), you locate the SSE in column three, which equals 56.80. In row three (Total), column three, you see the SSTO, which is 146.55. Using the values of SST, SSE, and SSTO from the Minitab output, you can verify that SST + SSE = SSTO.</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-93.jpg" width="49" height="51" class=""/></p>
<p><b>Figure 9-3:</b></p>
<p>ANOVA Minitab output for the watermelon seed spitting example.</p>
<p><b>One-Way ANOVA: Age Group 1, Age Group 2, Age Group 3, Age Group 4</b></p>
<p>Source Factor Error Total</p>
<p>DF 3 16 19</p>
<p>SS 89.75 5 6.80 146.55</p>
<p>MS 2 9.92 3.55</p>
<p>F</p>
<p>8.43</p>
<p>P</p>
<p>0.001</p>
<p>S — 1.884 R-Sq — 61.24% R-Sq(adj) — 53.97%</p>
<p>Now you&#8217;re ready to use these sums of squares to complete the next step of the F-test (keep reading).</p>
<p><b><i>Locating those mean sums of squares</i></b></p>
<p>After you have the sums of squares for treatment, SST, and the sums of squares for error, SSE (see preceding section for more on these), you want to compare them to see whether the variability in the y-values that is due to the model (SST) is large compared to the amount of error left over in the data after the groups have been accounted for (SSE). So you ultimately want a ratio comparing SST to SSE somehow. To make this ratio form a statistic that statisticians know how to work with (in this case, an F-statistic), they decided to find the mean of each of SST and SSE and work with that. Finding the mean sums of squares is the second step of the F-test.</p>
<p><i>MST </i>Is the mean sums of squares for treatments, which measures the mean variability that occurs between the different treatments (the different samples in the data). What you&#8217;re looking for is the amount of variability in the data as you move from one sample to another. A great deal of variability between samples (treatments) may indicate that the populations are different as well. You can find MST by taking SST and dividing by <i>K </i>- 1 (where <i>K </i>Is the number of treatments).</p>
<p><i>MSE </i>Is the mean sums of squares for error, which measures the mean within-treatment variability. The <i>Within-treatment variability </i>Is the amount of variability that you see within each sample itself, due to chance and/or other factors not included in the model. You can find MSE by taking SSE divided by <i>N </i>- <i>K </i>(where <i>N </i>Is the total sample size and <i>K </i>Is the number of treatments). The values of <i>K </i>- 1 and <i>N </i>- <i>K, </i>Respectively, are called the <i>Degrees of freedom </i>For SST and SSE. Minitab calculates and posts the degrees of freedom for SST and SSE, as well as the values of MST and MSE, in the ANOVA table in columns two and four, respectively.</p>
<p>From the ANOVA table for the seed spitting data in Figure 9-3, you can see that column two has the heading <i>DF, </i>Which stands for degrees of freedom. You can find the degrees of freedom for SST in the Factor row (row two); this value is equal to <i>K </i>- 1 = 4 &#8211; 1 = 3. The degrees of freedom for SSE is found to be <i>N </i>- <i>K </i>= 20 &#8211; 4 = 16. (Remember you have four age groups and five children in each group for a total of <i>N </i>= 20 data values.) The degrees of freedom for SSTO is <i>N </i>- 1 = 20 &#8211; 1 = 19 (found in the Total row under DF.) You can verify that the degrees of freedom for SSTO = degrees of freedom for SST + degrees of freedom for SSE.</p>
<p>The values of MST and MSE are shown in column four of Figure 9-3, with the heading MS. You can see the MST in the Factor row, which is 29.92. This value was calculated by taking SST = 89.75, and dividing it by degrees of freedom, 3. You can see MSE in the Error row, equal to 3.55. MSE is found by taking SSE = 56.80 and dividing that value by its degrees of freedom, 16.</p>
<p>By finding the mean sums of squares, you&#8217;ve completed step two of the F-test, but don&#8217;t stop here! You need to continue to the next section if you want to complete the process.</p>
<p><b><i>Figuring the F-statistic</i></b></p>
<p>The test statistic for the test of the equality of the <i>K </i>Population means is</p>
<p><i>F </i>= . The result of this formula is called the <i>F-statistic. </i>The F-statistic MSE</p>
<p>Has an <i>F</i>-distribution, which is equivalent to the square of a <i>T</i>-test (when the numerator degrees of freedom is 1). All F-distributions start at zero and are skewed to the right. The degree of curvature and the height of the curvature of each F-distribution is reflected in two <i>Degrees of freedom, </i>Represented by <i>K </i>- 1 and <i>N </i>- <i>K. </i>(These come from the denominators of MST and MSE, respectively, where <i>N </i>Is the total sample size and <i>K </i>Is the total number of treatments or populations.) A shorthand way of denoting the <i>F</i>-distribution for this test</p>
<p>Is <b><i>F(k </i></b><b>- 1,n &#8211; k).</b></p>
<p>In the watermelon seed spitting example, you&#8217;re comparing four means and have a sample of size five from each population. Figure 9-4 shows the corresponding <i>F</i>-distribution, which has degrees of freedom 4 &#8211; 1 = 3 and 20 &#8211; 4 = 16; in other words <b>16</b><b>)</b>.</p>
<p>You can see the <i>F</i>-statistic on the Minitab ANOVA output (see Figure 9-3) in the Factor row, under the column indicated by <i>F. </i>For the seed spitting example, the value of the <i>F</i>-statistic is 8.43. This number was found by taking MST = 29.92 divided by MSE = 3.55. You can then locate 8.43 on the <i>F</i>-distribution in Figure 9-4 to see where it stands. (More on that in the next section.)</p>
<p><b>F (3, 16)</b></p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-94.jpg" width="526" height="335" class=""/></p>
<p><b><i>Making conclusions from ANOVA</i></b></p>
<p>If you&#8217;ve completed the F-test and found your F-statistic (step four in the ANOVA process), you&#8217;re ready for step five of ANOVA: making conclusions for your hypothesis test of the <i>K </i>Population means. If you haven&#8217;t already, you can compare the F-statistic to the corresponding F-distribution with <i>K </i>- 1, <i>N </i>- <i>K </i>Degrees of freedom, to see where it stands and make a conclusion. You can make the conclusion in one of two ways: the p-value approach or the critical-value approach. (The approach you use depends primarily on whether you have access to a computer, especially during exams.) I describe these two approaches in the following sections.</p>
<p><b><i>Using the p-value approach</i></b></p>
<p>On Minitab ANOVA output (see Figure 9-3), the value of the F-statistic is located in the Factor row, under the column noted by F. The associated <i>P</i>-value for the <i>F</i>-test is located in the Factor row under the column headed by <i>P. </i>The p-value tells you whether or not you can reject Ho. If the p-value is less than your prespecified a (typically 0.05), reject Ho. Conclude that the <i>K </i>Population means aren&#8217;t all equal and that at least two of them are different. If the <i>P</i>-value is greater than a, then you can&#8217;t reject Ho. You don&#8217;t have enough evidence in your data to say the <i>K </i>Population means have any differences.</p>
<p>The F-statistic for comparing the mean watermelon seed spitting distances for the four age groups is 8.43. The p-value as indicated in Figure 9-3 is 0.001. That means the results are highly statistically significant. You reject Ho and conclude that at least one pair of age groups differ in its mean watermelon seed spitting distances. (You would hope that a 17-year-old could do a lot better than a 6-year-old, but maybe those 6-year-olds have a lot more spitting going on in their lives than 17-year-olds do.)</p>
<p>Using Figure 94, you see how the F-statistic of 8.43 stands on the F-distribution with (4 &#8211; 1, 20 &#8211; 4) = (3, 16) degrees of freedom. You can see it&#8217;s way off to the right, out of sight. It makes sense that the p-value, which measures the probability of being beyond that <i>F</i>-statistic, is 0.001.</p>
<p><b><i>Lf you&#8217;ve gotta use critical Values&#8230;</i></b></p>
<p>If you&#8217;re in a situation where you don&#8217;t have access to a computer (as is still the case in many statistics courses today when it comes to taking exams), finding the exact p-value for the F-statistic isn&#8217;t possible. However, statistical software packages automatically calculate all <i>P</i>-values exactly (so on any computer output you can see them as such).</p>
<p>To approximate the p-value from your F-statistic (in the event you don&#8217;t have a computer or computer output available), you find a cutoff value on the F-distribution with <i>(k </i>- 1, <i>N </i>- <i>K) </i>Degrees of freedom that draws a line in the sand between rejecting Ho and not rejecting Ho. This cutoff (also known as the <i>Critical value) </i>Is determined by your prespecified a (typically 0.05). You choose the critical value so that the area to its right on the <i>F</i>-distribution is equal to a.</p>
<p>Table A-5 in the Appendix shows the critical values of the F-distribution with various degrees of freedom, all using a = 0.05. Other F-distribution tables are available in various statistics textbooks and Internet links for other values of a; however, a = 0.05 is by far the most common a level used for the <i>F</i>-distribution and is sufficient for your purposes.</p>
<p>This table of values for the F-distribution is called the <i>F-table </i>(students are typically given these with their exams). For the seed spitting example, the <i>F</i>-statistic has an <i>F</i>-distribution with degrees of freedom (3, 16), which I calculate in a previous section. To find the critical value, go to Table A-5 in the Appendix. Because the degrees of freedom are (3, 16), go to column 3 and row 16 on the <i>F</i>-table. The critical value is 3.2389 (or 3.24). Your <i>F</i>-statistic for the seed spitting example is 8.43, which is well beyond this critical value (you can see how 8.43 compares to 3.24 by looking at Figure 9-4). Your conclusion is to reject Ho at level a. At least two of the age groups differ on mean seed spitting distances.</p>
<p>With the critical value approach, any F-statistic that lies beyond the critical value results in rejecting Ho, no matter how far or close to the line it is. If your F-statistic is beyond the value found in Table A-5, then you reject Ho and say at least two of the treatments (or populations) have different means.</p>
<p><b><i>What&#8217;s next?</i></b></p>
<p>After you&#8217;ve rejected Ho in the F-test and concluded that not all the populations means are the same, your next question may be: Which ones are different? You can answer that question by using a statistical technique called <i>Multiple comparisons. </i>Statisticians use many different multiple comparison procedures to further explore the means themselves after the <i>F</i>-test has been rejected. I discuss and apply some of the more common multiple comparison techniques in Chapter 10.</p>
<p><b><i>Checking the Fit of the ANOVA Model</i></b></p>
<p>As with any other model, you must determine how well the ANOVA model fits before you can use its results with confidence. In the case of ANOVA, the model basically boils down to a treatment variable (also known as the population you&#8217;re in) plus an error term. To assess how well that model fits the data, see the values of <i>R2 </i>And <i>R2 </i>Adjusted on the last line of the ANOVA output below the ANOVA table. For the seed spitting data, you see those values at the bottom of Figure 9-3.</p>
<p>The value of <i>R2 </i>Measures the percentage of the variability in the response variable <i>(y) </i>Explained by the explanatory variable <i>(x). </i>In the case of ANOVA, the <i>X </i>Variable is the factor due to treatment (where the treatment can represent a population being compared). A high value of <i>R2 </i>(say above 80 percent) means this model fits well. The value of <i>R2 </i>Adjusted, the preferred measure, takes <i>R2 </i>And adjusts it for the number of variables in the model. In the case of one-way ANOVA, you have only one variable, the factor due to treatment so <i>R2 </i>And <i>R2 </i>Adjusted won&#8217;t be very far apart. For more on <i>R2 </i>And <i>R2 </i>Adjusted, see Chapter 5.</p>
<p>For the watermelon seed spitting data, the value of <i>R2 </i>Adjusted (as found in the last row of Figure 9-3) is only 53.97 percent. That means age group (while shown to be statistically significant by the F-test; see the section &quot;Making conclusions from ANOVA&quot;) explains just over half of the variability in the watermelon seed spitting distances. Because age group alone explains only a little over half of what&#8217;s going on in the seed spitting distances, you may find other variables you can examine in addition to age group, making an even better model.</p>
<p><img src="/wp-content/uploads/intermediate statistics for dummies-95.jpg" width="57" height="60" class=""/><img src="/wp-content/uploads/intermediate statistics for dummies-96.jpg" width="62" height="60" class=""/></p>
<p>The results of the <i>T-test </i>Done to compare the spitting distances of males and females in the section &quot;Comparing Two Means with a t-Test&quot; (see Figure 9-1) showed that males and females were significantly different on mean seed spitting distances. So I would venture a guess that if you include gender as well as age group thereby creating what statisticians call a <i>Two-factor ANOVA (or two-way ANOVA), </i>The resulting model would fit the data even better, resulting in higher values of <i>R2 </i>And <i>R2 </i>Adjusted. (See Chapter 11 for two-way ANOVA.)</p>
</p>
<p>Many medical and psychological studies use designed experiments to compare the responses of several different treatments, looking for differences. A <i>Designed experiment </i>Is a study in which subjects are randomly assigned to treatments (experimental conditions) and their responses are recorded. The results are used to compare treatments to see which one(s) work best, which ones work equally well, and so on.</p>
<p>One example of one such experiment that employs ANOVA is from The Ohio State University research press release Web site. The experiment tested three traditional principles of writing refusal letters:</p>
<p>Using a buffer — a neutral or positive sentence that delays the negative information</p>
<p>Placing the reason before the refusal</p>
<p>Ending the letter on a positive note as a way of reselling the business</p>
<p>Subjects were randomly assigned to treatments, and their responses to the rejection letters were compared (likely on some sort of scale such as 1 = very negative to 7 = very positive with 4 being a neutral response).</p>
<p>This scenario can be analyzed by using ANOVA. It compares three treatments (forms of the rejection letters) on some quantitative variable (response to the letter). You can argue that this isn&#8217;t a continuous variable, because it has</p>
<p>Enough possible values that ANOVA isn&#8217;t unreasonable. The data were also shown to have a bell shape.</p>
<p>The null hypothesis would be Ho: Mean responses to the three types of rejection letters are equal, versus Ha: At least two forms of the rejection letter resulted in different mean responses.</p>
<p>In the end, the researcher did find some significant results. In other words, the different ways the rejection letter was written affected the participants in different ways. Using multiple comparison procedures (see Chapter 10), you would be able to go in and determine which forms of the rejection letters gave different responses and how the responses differed.</p>
<p>So in case you have to write a rejection letter at some point, the researcher recommends the following guidelines for writing it:</p>
<p>Don&#8217;t use buffers to begin negative messages.</p>
<p>Give a reason for the refusal when it makes the sender&#8217;s boss look good.</p>
<p>Present the negative positively but clearly; offer an alternative or compromise if possible.</p>
<p>A positive ending isn&#8217;t necessary.</p></p>
</sape_index><!--c715886456-->]]></content:encoded>
			<wfw:commentRss>http://ankar.info/2010/05/15/going-one-way-with-analysis-of-variance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

