Directions:

  • My main expectation is that you thoughtfully work through labs collaboratively with your group, discussing the embedded questions and recording your responses in a shared document.
    • At times you might be asked to add screenshots to your write-up. If you are on a Windows PC, an easy way to do this is the “snipping tool”, which you can find using the search bar along the bottom of your screen. If you are on a Mac, you can find instructions on how to take a screenshot at this link.
  • Everyone should upload their own copy of the lab write-up to Canvas
  • Only a couple of questions on each lab will be graded accuracy, so your focus should be on learning the material rather than “getting the right answers” as quickly as possible

\(~\)

Introduction

The purpose this lab is to practice applying concepts and procedures related to hypothesis testing. More specifically, \(Z\) and \(T\) tests performed on either a single sample, or used to compare data from two different samples/groups.

\(~\)

Concept Review

A hypothesis test seeks to falsify a certain null hypothesis using sample data.

We’ve now learned how to do this using the \(Z\)-test (categorical outcomes) and \(T\)-test (quantitative outcomes)

  1. State a falsifiable null hypothesis about the population being studied
  2. Find a \(Z\) or \(T\) value describing how many standard errors the observed outcome is above/below the null hypothesis
  3. Compare \(Z\) or \(T\) value against the appropriate probability model to find the \(p\)-value
  4. Use the \(p\)-value to make a decision

Below is a review of the different \(SE\) formulas from the CLT:

Summary measure population parameter sample estimate \(SE\)
single proportion \(p\) \(\hat{p}\) \(\sqrt{\tfrac{p*(1-p)}{n}}\)
difference of proportions \(p_1-p_2\) \(\hat{p}_1-\hat{p_2}\) \(\sqrt{\tfrac{p_1*(1-p_1)}{n_1} + \tfrac{p_2*(1-p_2)}{n_2}}\)
single mean \(\mu\) \(\bar{x}\) \(\tfrac{\sigma}{\sqrt{n}}\)
difference of means \(\mu_1 - \mu_2\) \(\bar{x}_1 - \bar{x}_2\) \(\sqrt{\tfrac{\sigma_1^2}{n_1} + \tfrac{\sigma_2^2}{n_2}}\)

The \(Z\)-test and \(T\)-test each rely test statistics of the form:

\[\text{test statistic} = \frac{\text{observed} - \text{null}}{SE}\] The test statistic is compared against an appropriate probability model to find the \(p\)-value and reach a conclusion.

\(~\)

Application #1 - Infant Heart Surgery

Some infants are born with congenital heart defects that require surgery shortly after birth. The standard surgical approach is known as “circulatory arrest”, and has the downside of cutting of the flow of blood to the brain during the surgery, potentially leading to brain damage. An alternative surgical approach is “low-flow bypass”, which maintains circulation to the brain, but does so with an external pump that might lead to other types of brain injuries. The goal of this study is to determine which surgical approach yields better developmental outcomes for infants born with congenial heart defects.

The Infant Heart Surgery dataset contains data from a randomized experiment conducted by surgeons at Harvard Medical School. The data document the outcomes of 70 infants who received low-flow bypass surgery, and 73 infants who received surgery under a circulatory arrest approach. The study considered two primary outcomes:

  • Psychomotor Development Index (PDI) - a composite score measuring physiological development, with higher scores indicating greater development
  • Mental Development Index (MDI) - a composite score measuring mental development, with higher scores indicating greater development

Additionally, the research team recorded the following variables for each infant:

  • Treatment - the type of surgery the infant received
  • Weight - the infant’s weight (in grams)
  • Length - the infant’s length (in cm)
  • Age - the infant’s age (in hours)
  • Sex - the infant’s sex (male or female)

CLICK HERE to download the dataset.

Question #1: What are the explanatory and response variables in this study? With this in mind, what are some graphs or tables might you use to convey the relationships or distributions of these variables? The purpose of this question is to help you practice for your final project.

Question #2: Determine whether the conditions are met to use a \(t\)-test to evaluate whether the mean PDI scores differ in the two surgical groups. (Hint: you can find these conditions on Slide #18 of our two-sample hypothesis testing slides)

Question #3: Perform a two-sample \(t\)-test to determine whether the new low-flow surgery leads to significantly better physiological development. Be sure to clearly state your hypotheses, show how your test statistic is calculated, and provide a \(p\)-value with an appropriate conclusion.

Question #4: Determine whether the conditions are met to use a \(t\)-test to evaluate whether the mean MDI scores differ in the two surgical groups.

Question #5: Perform a two-sample \(t\)-test to determine whether the new low-flow surgery leads to significantly better mental development. Be sure to clearly state your hypotheses, show how your test statistic is calculated, and provide a \(p\)-value with an appropriate conclusion.

Question #6: Suppose a critic of this study is concerned that there might be a sex imbalance across the two surgical groups. To address this concern, perform an appropriate two-sample hypothesis test comparing the proportion of male infants in each group. Be sure to clearly state your hypotheses, show how your test statistic is calculated, and provide a \(p\)-value with an appropriate conclusion.

Question #7: Considering the design of this study, briefly explain why the \(p\)-value you found in Question #6 was not statistically significant.

\(~\)

Application #2 - Hollywood Movies

The Hollywood Movies Dataset contains information on 970 movies released by various Hollywood production studios between 2007 and 2013. It contains the following variables:

  • Movie: Title of the movie
  • LeadStudio: Studio that produced the movie
  • RottenTomatoes: Rotten Tomatoes rating (from critics)
  • AudienceScore: Rotten Tomatoes rating (from the audience)
  • Story: Category of the movies general theme
  • Genre: One of 14 possible genres
  • TheatersOpenWeek: Number of theaters the movie was in screened in on opening weekend
  • OpeningWeekend: Gross revenue on opening weekend
  • BOAverageOpenWeek: Average box office income per theater on opening weekend
  • DomesticGross: Gross income for domestic viewers (in millions)
  • ForeignGross: Gross income for foreign viewers (in millions)
  • WorldGross: Gross income for all viewers (in millions)
  • Budget: Production budget (in millions)
  • Profitability: WorldGross as a percentage of Budget
  • OpenProfit: Percentage of budget earned on opening weekend
  • Year: The year that the movie was released

CLICK HERE to download the dataset.

  • Note: This application is intended to provide you practice in choosing the proper statistical test for various different types of research questions (so not every question will require a two-sample test).

\(~\)

Question #8: While animated movies tend to be very memorable, they make up a relatively small fraction of major films. For this question, use these data to statistically test whether fewer than 10% of Hollywood Movies belong to the “Animation” genre. Be sure to clearly state your hypotheses, show how your test statistic is calculated, and provide a \(p\)-value with an appropriate conclusion.

Question #9: Perform a hypothesis test to determine whether is statistical evidence to conclude that Paramount Studios’ movies have higher budgets than Universal Studios’ movies. Be sure to clearly state your hypotheses, show how your test statistic is calculated, and provide a \(p\)-value with an appropriate conclusion.

Question #10: Perform a hypothesis test to determine whether is statistical evidence to conclude that a lower proportion of movies produced by Paramount are in the “Action” genre relative to the movies produced by Universal Studios. Be sure to clearly state your hypotheses, show how your test statistic is calculated, and provide a \(p\)-value with an appropriate conclusion.