HotDog_ttest_Simulation

=Hypothesis Testing - Hot Dogs = Post: November 11, 2015 In this activity, we compared the mean calorie content between poultry and beef for various brands of hot dogs. We asked the question, if left to chance, would there be a difference as great, or greater, than what is observed in the given data? Is the difference between the means “real” or due to chance? A hot dog data set from DASL was used to complete this simulation.

I calculated the following statistics on the calories attribute for the poultry and beef hot dogs (see Table 1). Poultry: mu = 118.8 calories and n = 17 Beef: mu = 156.9 calories and n = 20 Key Question: Is the difference between the means (156.9 – 118.8) = 38.1 calories, unusual enough for us to say that the beef hot dogs have a higher calorie content than the poultry hot dogs? Is the difference "statistically significant"?

Before starting the by hand simulation, we discussed hot dogs in general and then two teams were asked to make a conjecture for the key question. Both groups decided that the difference of the means was not statistically significant, that the difference was "not that great".

Table 1. Means for the calorie content of the poultry and beef hot dogs are shown at the bottom of the table
 * 86 || 111 ||
 * 87 || 131 ||
 * 94 || 132 ||
 * 99 || 135 ||
 * 102 || 139 ||
 * 102 || 141 ||
 * 106 || 148 ||
 * 107 || 149 ||
 * 113 || 149 ||
 * 129 || 152 ||
 * 132 || 153 ||
 * 135 || 157 ||
 * 142 || 158 ||
 * 143 || 175 ||
 * 144 || 176 ||
 * 146 || 181 ||
 * 152 || 184 ||
 * || 186 ||
 * || 190 ||
 * || 190 ||
 * 118.8 || 156.9 ||
 * Diff = || 38.1 ||
 * Poultry || Beef ||

=SIMULATION METHOD ONE - By HAND = To complete this simulation by hand, complete the following steps. Step 1. Write the calorie content for each of the 37 hot dogs on small slips of paper or print and separate the information as shown in Figure 1. Table 2. Data card layout in the Excel file provided below.
 * Beef || 186 || Calories || Beef || 495 || Sodium ||
 * Beef || 181 || Calories || Beef || 477 || Sodium ||

Step 2. Have students shuffle the slips of paper and count them out into two groups; one group of 17 and another of 20. Note that the assignment into the two groups has been left to chance.

Figure 1.  Step 3. Find the difference of the means between the two groups. To be consistent,we subtracted the mean of the group with n = 20 from the mean of the group with n=17. Undergraduate students in my fall 2015 Introduction to Secondary Mathematics completed this activity. The results are shown below. Step 4. Discussion - Notice the variability here. Do you think that, on repeated sampling, the difference would ever be +38.1 calories or greater? After running the simulation six times, the students were somewhat confident that there was a statistically significant difference. We created a dot plot of the six values and noted that all of the data were between -12 and 12 and that if we put a point on 38.1, our point would be way off their papers. None of the simulations yielded a difference anywhere close to 38.1 calories.
 * Figure 2. Team 1: Differences were -6.1, -10.9 and -8.3 (not shown) || Figure 3. Team 2: Differences were -6, -4, and +8.2 calories ||
 * [[image:Team1Results.png]] || [[image:Team2Results.png width="363" height="501" align="left"]] ||

=Simulation Method Two - Excel = A second method for conducting the situation was demonstrated with Excel. A random digit generator was used to create two groups. Table 3 shows a random digit generator round(rand,3) in the third column. After randomizing the list, I let the first 17 data points be Group 1 and the remaining 20 data points be Group 2. Table 4 shows the results of three different simulations. Table 3. Simulation design for random grouping
 * Poultry || 106 || 0.132 ||
 * Poultry || 102 || 0.811 ||
 * Beef || 157 || 0.115 ||
 * Beef || 149 || 0.631 ||
 * Beef || 135 || 0.026 ||
 * Beef || 190 || 0.637 ||
 * Beef || 139 || 0.001 ||
 * Beef || 152 || 0.331 ||
 * Poultry || 143 || 0.427 ||
 * Beef || 184 || 0.392 ||
 * Beef || 158 || 0.819 ||
 * Poultry || 142 || 0.909 ||
 * Poultry || 144 || 0.366 ||
 * Beef || 186 || 0.899 ||
 * Beef || 132 || 0.015 ||
 * Beef || 181 || 0.576 ||
 * Poultry || 94 || 0.247 ||
 * Poultry || 86 || 0.933 ||
 * Beef || 149 || 0.026 ||
 * Beef || 153 || 0.582 ||
 * Poultry || 102 || 0.206 ||
 * Poultry || 129 || 0.519 ||
 * Beef || 111 || 0.615 ||
 * Poultry || 135 || 0.24 ||
 * Beef || 175 || 0.36 ||
 * Beef || 131 || 0.514 ||
 * Beef || 141 || 0.657 ||
 * Poultry || 152 || 0.501 ||
 * Poultry || 87 || 0.935 ||
 * Poultry || 132 || 0.089 ||
 * Beef || 148 || 0.473 ||
 * Poultry || 113 || 0.267 ||
 * Poultry || 99 || 0.558 ||
 * Poultry || 107 || 0.533 ||
 * Poultry || 146 || 0.945 ||
 * Beef || 190 || 0.422 ||
 * Beef || 176 || 0.257 ||
 * Type || Calories || Rand ||

Then, I calculated the mean of the two random groups (these are not Poultry or Beef) for three different random assignments. The differences of +6.6, +24.5 and -11.9 calories are shown in the bottom row of Table 4.

Table 4. Three sets of random group assignments with the diff of means in the last row
 * First || Simulation || Second || Simulation || Third || Simulation ||
 * 94 || 149 || 102 || 143 || 181 || 129 ||
 * 102 || 141 || 94 || 152 || 149 || 144 ||
 * 131 || 113 || 102 || 132 || 148 || 142 ||
 * 152 || 181 || 87 || 149 || 157 || 176 ||
 * 158 || 102 || 148 || 152 || 94 || 107 ||
 * 184 || 190 || 146 || 181 || 135 || 186 ||
 * 153 || 99 || 158 || 139 || 146 || 86 ||
 * 157 || 132 || 111 || 141 || 190 || 152 ||
 * 111 || 139 || 86 || 135 || 143 || 132 ||
 * 152 || 186 || 186 || 144 || 153 || 111 ||
 * 142 || 129 || 129 || 184 || 175 || 152 ||
 * 106 || 144 || 132 || 99 || 158 || 132 ||
 * 132 || 146 || 190 || 176 || 87 || 149 ||
 * 87 || 107 || 142 || 131 || 131 || 102 ||
 * 135 || 86 || 153 || 107 || 190 || 106 ||
 * 148 || 176 || 135 || 157 || 102 || 99 ||
 * 149 || 135 || 106 || 175 || 139 || 113 ||
 * || 143 ||  || 149 ||   || 135 ||
 * || 190 ||  || 190 ||   || 141 ||
 * || 175 ||  || 113 ||   || 184 ||
 * 134.9 || 141.5 || 123 || 147.5 || 145.8 || 133.9 ||
 * Diff = || 6.6 || Diff = || 24.5 || Diff = || -11.9 ||
 * Diff = || 6.6 || Diff = || 24.5 || Diff = || -11.9 ||

=T-Test Results = After completing the simulation by hand and with Excel, I introduced the t-test for the difference of two means. The results of the test [t-stat = 5.1 and p<0.0001] did not make much sense to my undergraduates. From past experience, the necessary link is to be able to collect large samples of differences AND look at the distribution curve of the differences. This is the main reason that I prefer to complete the HT simulation in TinkerPlots.

Beef vs Poultry Calories - TinkerPlots with detailed steps shown

Goal: Determine if there is a statistically significant difference in the mean number of calories between two types of hot dogs.

Beef vs Poultry Sodium - TinkerPlots with detailed steps shown

Goal: Determine if there is a statistically significant difference in the mean grams of sodium between two types of hot dogs.