Data In The Wild
  1. Module 3
  2. Assignment 1
  • Home
  • Contact Us
  • For Instructors

  • Module 1
    • Overview
    • 1.1: Introduction to R and RStudio
    • 1.2: Intro to Coding in R
    • 1.3: Introduction to the tidyverse
    • Assignment 2
    • Assignment 3
  • Module 2
    • Overview
    • 2.1: Good Food Gone Bad
    • 2.2: Plotting with ggplot2
    • 2.3: Data Visualization
    • 2.4: Exploring geom Functions
    • 2.5: Module 2 Wrap-Up
    • Assignment 1
    • Assignment 2
    • Assignment 3
  • Module 3
    • Overview
    • 3.1: Leopard Seals
    • 3.2: T-Tests
    • 3.3: Comparing (Multiple) Means
    • Assignment 1
    • Assignment 2
  • Module 4
    • Overview
    • 4.1: Combining Datasets (Joins & Binds)
    • 4.2: K-Nearest Neighbor
    • 4.3: Roads and Regressions
    • 4.4: Multiple Regression
    • 4.5: Writing Functions
    • Assignment 1
    • Assignment 2
    • Assignment 3
    • Assignment 4
  • Module 5
    • Overview
    • 5.1: Population Growth
    • 5.2: Sustainable Fishing
    • 5.3: Comparing Populations
    • Assignment 1
    • Assignment 2
    • Assignment 3
  • Final Project

  • Resources

On this page

  • Assignment Details
    • Purpose
    • Task
    • Criteria for Success
  • Assignment Questions
    • Set-Up
    • Numeric
    • Visual
    • Statistic
  • Turning in Your Assignment
  1. Module 3
  2. Assignment 1

Module 3, Assignment 1: Comparing Two Means

Author

Ellen Bledsoe, Lily McMullen

Assignment Details

Purpose

The goal of this assignment is to assess your ability to compare means numerically, visually, and statistically

Task

Write R code which produces the correct answers and correctly interpret the results of visualizations and statistical tests.

Criteria for Success

  • Code is within the provided code chunks
  • Code chunks run without errors
  • Code produces the correct result
    • Code that produces the correct answer will receive full credit
    • Code attempts with logical direction will receive partial credit
  • Written answers address the questions in sufficient detail

Assignment Questions

In this assignment, we’re going to explore another data set on wind turbines that generate a significant portion of the energy for us down here in Antarctica.

Set-Up

Let’s load the tidyverse and read in the data set called wind_turbines.csv. Call the data turbines.

  1. Explore the data set, either through the environment or through code. Answer the following questions (2 points):

    1. How many turbine companies are represented in the data?
    2. What do the data in each row of data represent?
# optional; only if you want space for coding

Numeric

  1. Generate a summary of the data set that calculates the average required wind speed and mean power output for each wind turbine company. Save this as a data frame called turbine_summary. (2 points)

Visual

  1. Create a multiple histogram plot for the power output variable. (3 points)

    • be sure to have a histogram for each turbine producer; the color and/or the fill should be determined by the maker of the turbine. They should also be transparent and not stacked vertically.
    • set the number of bins to 10
    • add in vertical lines for the mean values in the same color as the turbine makers (remember to reference the correct data frame!)
    • make sure the x-axis, y-axis, and legend labels are capitalized and easier to understand
    • use the theme_classic() function
  1. Generate a box-and-whisker plot that compares the required wind speed between different turbine makers (3 points).

    The plot should:

    • have capitalized and more descriptive axis labels (hint: wind speed is measured in km/hr, kilometers per hour.)
    • show raw data points in addition to the boxes. The points should be jittered.
    • use the theme_classic() function

Statistic

  1. Write a null hypothesis and an alternative hypothesis for each question we are asking. (2 points)

Is there a significant difference in the power output from turbines from the different companies?

  • Null Hypothesis (H0):
  • Alternative Hypothesis (HA):

Is there a significant difference in the required wind speeds for turbines from different companies?

  • Null Hypothesis (H0):
  • Alternative Hypothesis (HA):
  1. Based on the mean values in the turbine_summary data frame and the plots you’ve created above, predict the outcome of each t-test that we will run: (1) comparing wind speeds between turbine companies and (2) comparing power outputs between companies. (This question graded for completion, not accuracy; 2 points)

    Explain your reasoning (1-2 sentences for each t-test is fine).

    Answer:

  2. Perform a t-test to determine if there is a significant difference in the power output between turbine makers. (1 point)

  1. In 2-3 sentences, interpret the output from Question 7. Focus on what the p-value is in reference to the cutoff of 0.05, what that means, and whether that means we reject or fail to reject the null hypothesis. (2 points)

    Answer:

  2. Perform another t-test, this time to determine whether the required wind speed differs significantly between manufacturers. (1 point)

  1. In 2-3 sentences, interpret the output from Question 9; focus on the same ideas as in Question 8. (2 points)

    Answer:

Turning in Your Assignment

  1. Make sure your name is filled in at the top of the document.
  2. Click the Render button at the top of this document. This will produce an HTML file that opens in a new tab and also saves to the Files panel on the bottom-right of your screen.
  3. To download the HTML file from Posit Cloud, click the empty box to the left of it in the Files panel.
  4. Click the blue gear at the top of the Files panel and choose Export.
  5. Put your last name at the front of the file name when prompted, then click Download. The file is now in your Downloads folder.

2026, University of Arizona & Lewis & Clark College

 
  • Made with Quarto