$\$
In the following homework you will gain practice running hypothesis tests for two means. Please submit a compiled pdf with your answers to the exercises to Gradescope by 11pm on Sunday March 3rd. This homework has intentionally been kept a littler shorter than other homework to give you a little more time to study for the midterm exam. Five points will be taken off if you do not mark the pages for each problem on Gradescope.
A list of functions we have used in class can be found on Canvas. You might also find the following symbols useful: $\mu$, $H_0$, $H_a$, $\mu_{sleep}$, $\bar{x}_{control}$, $\ne$, $\alpha$, $H_0$ and $H_a$. For full credit on problems involving R, be sure to label all your figures and to "show your work" by making sure all values that are answers to questions are printed/visible in your R Markdown pdf.
As always, if you need help with any of the homework assignments, please attend the TA office hours which are listed on Canvas and/or ask questions on Ed Discussions forum. Also, if you have completed the homework, please help others out by answering questions on Ed Discussions. Finally, reviewing the class slides and videos will be helpful if you run into difficulties.
Note about the homework: Unless otherwise noted in a specific problem, for all questions you should assume we are using a significance level of $\alpha = 0.05$. This means we would reject the null hypothesis if a p-value is less than 0.05 and fail to reject the null hypothesis if the p-value is greater than 0.05. We will talk more about significance levels soon!
download.file("https://raw.githubusercontent.com/emeyers/SDS100/master/ClassMaterial/images/Lock5_4_20.png", "Lock5_4_20.png", mode = "wb")
options(scipen=999) set.seed(100) library(SDS100)
$\$
Exercise 1 (9 points): Arsenic in Chicken A study was done to determine if the mean level of arsenic in chicken meat is above 80 ppb. If a restaurant chain finds significant evidence that the mean arsenic level is above 80, the chain will stop using that supplier of chicken meat. The hypotheses are:
$H_0: \mu = 80$
$H_a: \mu > 80$
Where $\mu$ represents the mean arsenic level in all chicken meat from that supplier. Samples from two different suppliers are analyzed, and the resulting p-values are given:
Sample from Supplier A: p-value is 0.0003
Sample from Supplier B: p-value is 0.3500
a. Interpret each p-value in terms of the probability of the results happening by random chance.
b. Which p-value shows stronger evidence for the alternative hypothesis? What does this mean in terms of arsenic and chickens?
c. Which supplier, A or B, should the chain get chickens from in order to avoid too high a level of arsenic?
Answers:
a.
b.
c.
$\$
Exercise 2 (8 points): Smiles and Leniency. An experiment was conducted by LeFrance and Hect to study the effects of smiling on leniency in judging students accused of cheating. Participants in the experiment took on the role of members of a college disciplinary panel judging students accused of cheating. For each suspect, along with a description of the offense, a picture was provided with either a smile or a neutral facial expression. A leniency score was calculated based on the disciplinary decisions made by the participants. The experimenters believed that the average leniency score would be higher for smiling students ($\mu_s$) than the average for students who had neutral expressions ($\mu_n$) .
Let’s examine the hypothesis that $H_0: \mu_s = \mu_n$ vs. $H_a: \mu_s > \mu_n$ and use data to test if there is evidence that average leniency score is higher for smiling students ($\mu_s$) than for students with a neutral expressions ($\mu_n$ ). A dot plot for the difference in sample means based on 1,000 random assignments of leniency scores from the original sample to smile and neutral groups is shown in Figure 1.
a. The difference in sample means for the original samples is $D = \bar{x}_s - \bar{x}_n$ = 4.91 – 4.12 = 0.79 (as shown in Figure 4.20). What is the p-value for the one-tailed test? Hint: There are 27 dots in the tail beyond 0.79.
b. We can also consider the test with a two-tailed alternative, $H_0: \mu_s = \mu_n$ vs. $H_a: \mu_s \ne \mu_n$, where we make no assumption in advance on whether smiling helps or discourages leniency. How would the null distribution in Figure 4.20 change for this test? How would the p-value change?
Answers:
a.
b.
$\$
Exercise 3 (points 12): Preliminary note: For this next question we will use the "Neyman-Pearson paradigm" of hypothesis testing where we will make a strict decision that a result is statistically significant if a p-value is less than a particular "significance level" value. We will discuss the Neyman-Pearson paradigm more soon. For the questions below, if the p-value is less than 0.05 we will reject the null hypothesis (as we will discuss in class, we will say that we set "$\alpha = 0.05$" so if the p-value is less than 0.05 we will reject the null hypothesis).
Sleep or Caffeine for Memory? The consumption of caffeine to benefit alertness is a common activity practiced by 90% of adults in North America. Often caffeine is used in order to replace the need for sleep. One recent study compares students’ ability to recall memorized information after either the consumption of caffeine or a brief sleep. A random sample of 35 adults (between the ages of 18 and 39) were randomly divided into three groups and verbally given a list of 24 words to memorize. During a break, one of the groups takes a nap for an hour and a half, another group is kept awake and then given a caffeine pill an hour prior to the testing, and a third group is given a placebo. The response variable of interest is the number of words participants are able to recall following the break.
The summary statistics for the three groups are in Table 1. We are interested in testing whether there is evidence of a difference in average recall ability between any two of the treatments. Thus we have three possible tests between different pairs of groups: Sleep vs Caffeine, Sleep vs Placebo, and Caffeine vs Placebo.
a. In the test comparing the sleep group to the caffeine group, the p-value is 0.003. What is the conclusion of the test? In the sample, which group had better recall ability? According to the test results, do you think sleep is really better than caffeine for recall ability?
b. In the test comparing sleep group to the placebo group, the p-value is 0.06. What is the conclusion of the test using a 5% significance level and/or at the 10% significance level? How strong is the evidence of a difference in mean recall ability between these two treatments?
c. In the test comparing the caffeine group to the placebo group, the p-value is 0.22. What is the conclusion of the test? In the sample, which group had better recall ability? According to the test results, would we be justified in concluding that caffeine impairs recall ability?
d. According to this study, what should you do before an exam that asks you to recall information?
Table 1: Effect of sleep and caffeine on memory
| Group | Sample size | Mean | Standard deviation |
|----------|--------------|----------|---------------------|
| Sleep | 12 | 15.25 | 3.3 |
| Caffeine | 12 | 12.25 | 3.5 |
| Placebo | 11 | 13.70 | 3.0 |
Answers:
a.
b.
c.
d.
$\$
Exercise 4 (18 points): Effect of Sleep and Caffeine on Memory Continuing with the analysis of sleep on memory, let's now run the actual hypothesis test to see if there really is a statistically significant difference between the group that got sleep and the group that got caffeine. Please answer the following questions:
a. State the null and alternative hypotheses using words and symbols (step 1).
b. What statistic will we record, and what symbols should we use to denote this statistic? What is the value of that statistic for the observed sample (step 2)?
c. Where will the null distribution be centered?
d. Find one point on the null distribution by randomly dividing the 24 data values into two groups (using the R chunk below). Describe how you divided the data into two groups. Compute the sample mean in each group and show the difference in the sample means for these simulated results.
e. Use R to create a null distribution (step 3) and display a visualization of this null distribution with a red vertical line at the value of the observed statistic. Also calculate the p-value for the observed difference in means calculated in part (b).
f. Do the results seem statistically significant (step 5)? What does this mean in the context of the question discussed in this study?
Answers:
a.
b.
c.
d.
e.
f.
# here is the data from the study sleep_condition <- c(14, 18, 11, 13, 18, 17, 21, 9, 16, 17, 14, 15) caffeine_condition <- c(12, 12, 14, 13, 6, 18, 14, 16, 10, 7, 15, 10) # compute the observed statistic # compute one randomized statistic for part d # compute the full null distribution can get the p-value for part e # plot the null distribution # calculate the p-value
$\$
Exercise 5 (5 points): Midterm exam practice problem
In order to have more practice problems for the midterm exam, please create a practice problem that seems appropriate to you. Once you have created the problem, post it to Canvas under the Discussion navigation link (which is right below the Ed Discussions navigation link). Also write your practice problem below. You can the use questions others wrote as practice for the exam. Provided a few good questions are posted, I will use one of them on the actual exam.
Answer:
Post your practice problem here.
$\$
Please reflect on how the homework went by going to Canvas, going to the Quizzes link, and clicking on Reflection on homework 6.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.