Question: Math 338 Lab Assignment #12 Spring 2017 Due Date: April 25, 2017 Part I. ANOVA test for means In the final part of this lab,

Math 338 Lab Assignment #12 Spring 2017 Due Date: April 25, 2017 Part I. ANOVA test for means In the final part of this lab, we will analysis the OrchardSpray dataset in RStudio. The chickwts data frame has 71 rows and 2 columns from an experiment on the effect of diet on early growth of chicks. > data("chickwts") We can examine the data by the following command: > View(chickwts) We can obtain the side-by-side boxplots... > boxplot(weight ~ feed, data = chickwts) Question #1 Insert the boxplot below. Obtain the ANOVA table for testing the hypothesis that the treatments repel honeybees equally. > aov.out = aov(weight ~ feed, data = chickwts) > summary(aov.out) Question #2 Copy and paste the ANOVA table below. Question #3 Write out the four steps for this hypothesis test. Part II. Chi-Square Goodness-of-Fit Test Let's check to see is RStudio's random number generator is indeed random. We will do this by randomly drawing integers from 1 to 4 from RStudio, and then perform a Chi-Squared Goodness-of-Fit test on the integers we draw. We will draw a total of 100 values. Question #4 If RStudio is indeed drawing at random, how many of each integer would we expect to draw? Question #5 Write out the null and alternative hypothesis for this test. Now, let's obtain our data! > draws = sample.int(4, size =100, replace =TRUE) > table(draws) Question #6 How many draws did you get for each category (i.e., 1, 2, 3, 4)? Question #7 Compute your test statistic by hand. Question #8 What is the sampling distribution of your test statistic (i.e., what is the distribution and the degrees of freedom)? Question #9 Verify that the critical value is 7.815, by looking at the Chi-Square table. What do you conclude about the authenticity of RStudio's random generator? Let's verify our results by running the Goodness-of-Fit test in RStudio. > chisq.test(table(draws)) Question #10 Copy and paste your output from RStudio below. Question #11 What is the test statistic? Does it match what you computed? Question #12 What is the p-value? Is it consistent with your conclusions in Question #6? Part III. Chi-Square Test for Independence In this part of the lab, we will use a dataset on smokers to answer the question if frequency of smoking is independent of frequency of exercise. In this dataset there are four levels of smoking (Heavy, Never, Occasionally, and Regular) and three levels of exercise (Frequently, None, and Some). Obtain the dataset in RStudio by inputing the following commands: > library(MASS) > tbl = table(survey$Smoke, survey$Exer) > tbl Question #13 Copy and paste your output below. This is a rather large table to compute the test statistic by hand, so let's make RStudio do the work for us! > chisq.test(tbl) Question #14 Copy and paste your output below. Question #15 Use the output to write out the four steps of the hypothesis test for independence

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!