Meet your team!

Check on Ed to see your team assignment. This will be your team for labs for the semester. Before you get started on the lab itself, we’ll take a few minutes to help you develop a plan for working as a team.

Taylor Swift's official discography

You will find the dataset for this week's lab in your lab repository, which has already been created for you. Taylor Swift has a large discography which has at this point spanned decades. After its uploading to Spotify in 2017, Spotify's automated music analysis tools were able to analyze features of Taylor Swift's music.

Today's data were compiled by W. Jake Thompson using the Spotify API.

In this lab we will work with data from Spotify regarding musical aspects of Taylor Swift's album discographies to examine relationships in the data.

The learning goals of this lab are to practice working as a team, and also to reinforce skills learned regarding linear regression with a single continuous predictor.

Each step in the process will be outlined - pay attention to the directions carefully, or else you may run into a merge conflict (uh oh!). In next week’s lab, we will learn how to resolve merge conflicts, but let’s go one step at a time to work as a team first.

Not only will your grade be based on answers to the lab assignment, but also on whether each team member was able to successfull commit and push their assigned question. Watch out for all of the steps below (especially “when to pull”).

Clone assignment repo + start new project

A repository has already been created for you and your teammates. Everyone in your team has access to the same repo. Note that if you do not have access to the repository, it is likely because you have not yet joined the STA 210 course organization. Consult a TA if you do not see your lab repository.

Workflow: Using git and GitHub as a team

The following steps must be done in order.

Assign each person on your team a number 1 through 4. For teams of three, Member 1 can take on the role of Member 4.

Only one person should type in the .Rmd file and push updates at a time.

When it is not your turn to type, you should still share ideas and contribute to the team’s discussion.

Team Member 1: Change the author to your team name and include each team member’s name in the author field of the YAML in the following format. Team Name: Member 1, Member 2, Member 3, Member 4.

For instance: The Fantastic Four: Mr. Fantastic, Invisible Woman, Human Torch, The Thing

We’ll use the tidyverse package for this analysis. Run the following code to load this package.

library(tidyverse)

The data

The dataset for this assignment can be found as a csv file in the data folder of your repository. You can read it in using the following code (fill in the blank, giving the dataset a meaningful name in R).

____ <- read_csv("data/____.csv")

Exercises

Team Member 1: Type the team’s responses to exercise 1 (everyone else, hands off!).

  1. How many observations and how many variables are in the dataset? Write the answer as narrative in the space provided.

Team Member 1: Knit your .pdf, commit and push your changes to GitHub with an appropriate commit message again. Make sure to commit and push all changed files so that your Git pane is cleared up afterwards.

All other team members: Pull to get the updated documents GitHub. Click on the .Rmd file, and you should see the responses to exercises 1 and 2.

Team Member 2: It’s your turn! Type the team’s response to exercise 2 below (everyone else, hands off!):

  1. Fit a model that predicts the energy of a song using the tempo of the song. Plot a graph that corresponds to this relationship, and provide the estimates of the slope and intercept in the narrative area of your markdown document (no need for you to interpret them here). For your reference, the tempo of the song is recorded in beats per minute, and the energy of a song is automatically generated by Spotify to be a score between 0 and 1 that measures the intensity/activity of a song (the units are simply units in the Spotify energy score).

Team Member 2: Knit your .pdf, commit and push your changes to GitHub with an appropriate commit message again. Make sure to commit and push all changed files so that your Git pane is cleared up afterwards.

All other team members: Pull to get the updated documents GitHub. Click on the .Rmd file, and you should see the responses to exercise 2.

Team Member 3: It’s your turn! Type the team’s response to exercise 3.

  1. Interpret the slope and intercept in context. Is there sufficient evidence to suggest a linear relationship between these two variables at the 0.05 significance level? Provide the p-value and your conclusion.

Team Member 3: Knit your .pdf, commit and push your changes to GitHub with an appropriate commit message again. Make sure to commit and push all changed files so that your Git pane is cleared up afterwards.

All other team members: Pull to get the updated documents GitHub. Click on the .Rmd file, and you should see the responses to exercise 3.

Team Member 4 (or back to Team Member 1): It’s your turn! Type the team’s response to the last exercise below.

  1. Now fit a separate linear model that predicts the energy of a song using the acousticness of a song. Plot a graph that coresponds to this relationship, provide the estimates of the slope and intercept, and interpret them in context. Is there sufficient evidence to suggest a linear relationship between these two variables at the 0.05 significance level? Provide the p-value and your conclusion. The acousticness of a song is another automatically generated Spotify score ranging from 0 to 1.

Team Member 4: Knit your .pdf, commit and push your changes to GitHub with an appropriate commit message again. Make sure to commit and push all changed files so that your Git pane is cleared up afterwards.

All other team members: Pull to get the updated documents GitHub. Click on the .Rmd file, and you should see the team’s completed lab.

Wrapping up

Team Member 2: Make any edits as needed. Then knit, commit, and push the updated documents to GitHub if you made any changes.

All other team members: click to pull the finalized document.

Submission

Team Member 3: Upload the team’s PDF to Gradescope. Be sure to include every team member’s name in the Gradescope submission, and then "associate" the answer to each of the exercises. If any answer spans multiple pages, then mark all pages.

There should only be one submission per team on Gradescope.