## Recipe 5.7. Conducting ANOVA## ProblemYou'd like to conduct an ## SolutionThe Analysis ToolPak offers three flavors of ANOVA: single factor, two-factor with replication, and two-factor without replication. Select Tools images/U2192.jpg border=0> Data Analysis from the main menu bar to access these tools. ## DiscussionBy way of example, consider the hypothetical drug effectiveness data shown in Figure 5-19. The data values represent some measure of merit, or effectiveness, for drugs A, B, and C, along with a control group. The Anova: Single Factor tool allows you to perform an analysis of variance for two or more groups, so we'll use that tool to test the hypothesis that there's no difference between the means of these groups. After selecting the Anova: Single Factor tool from the Data Analysis dialog box, you should see the Anova: Single Factor dialog box like the one shown in Figure 5-20. In the Input Range field, type or select the cell range containing all the data under consideration. Your dataset must be in contiguous columns for this tool. If you include the column labels as I did in this example, then be sure to check the "Labels in first row" option. You can set the Alpha parameter to whatever you'd like. In this case I left it at 5%. Finally, choose your output options and press OK. Here, I chose to generate the output in the same worksheet, starting in cell E178. The results of this analysis are shown in Figure 5-21. These results show descriptive statistics for each group, along with standard ANOVA information. ANOVA results are displayed for between groups and within groups. ## Figure 5-19. Drug effectiveness## Figure 5-20. Anova: Single Factor dialog box## Figure 5-21. ANOVA results## See AlsoTo learn more about the Analysis ToolPak ANOVA tools, read the Excel help topic "About statistical analysis tools." Refer to any standard text that covers statistical tests, or tests of significance, to learn more about ANOVA and other statistical tests. |

## Recipe 5.8. Generating Random Numbers## ProblemYou'd like to compute random numbers between specific upper and lower bounds and you're not sure how to do so in Excel. ## SolutionUse Excel's built-in spreadsheet function ## Discussion
To compute a random number between two specific values, use the formula MinVal)+, where MinVal and MinVal are the two values between which you want the random number to be generated. The result will be a real number. To generate a random integer, use MaxVal=ROUND(RAND( )*(MaxVal-MinVal)+MinVal, 0).You can use the VBA function ## See AlsoSee Recipe 13.4 for an example that uses random numbers. Generating random numbers can also be useful when selecting random samples from some population. Recipe 13.7 shows how to select random samples from a population where the probability of selecting any given sample is not uniform. In cases where you need to draw samples from a finite population of discrete values, you should consider the Sampling tool . This tool is discussed in Recipe 5.9. |