Skip to content

Commit 012d2d0

Browse files
committed
Correct template for lab 5 rmd
1 parent b9f0a71 commit 012d2d0

1 file changed

Lines changed: 26 additions & 74 deletions

File tree

files/_lab-rmd/lab-5_cor.Rmd

Lines changed: 26 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Lab 5: Relationships in Bechdel"
2+
title: "Lab 5: Spotify Songs"
33
author: "Your Name Here"
44
date: "`r Sys.Date()`"
55
output: html_document
@@ -16,100 +16,52 @@ output: html_document
1616
1717
```
1818

19-
## Task 1: Compute scores for scales
19+
## Scenario and Goal
2020

21-
Be sure to compute the appropriate total scores for the ESS, ASHS and Attention variables.
21+
We have been asked by an up and coming music artist to use our advanced data analytic skills to see what has been related to the most popular songs. They have provided us with all of this data for recent popular songs that have been streamed the most.
2222

23-
Once completed, only include students who have "passed" the attention check (i.e., having a score of 4 or higher on the attention sum total).
23+
Our goal is to identify which variable is most related to higher streams. These variables that they are looking at are things like danceability, instrumentalness, etc.
2424

25-
*hint: use dplyr and filter*
25+
### Variables of Interest
2626

27-
```{r}
28-
## Task 1: Computing scales
29-
30-
31-
32-
```
27+
- `streams`: The number of streams for the individual song
3328

34-
## Task 2: Roommates and Daytime Sleepiness (A Group Comparison)
29+
- Percentage Variables: These variables reflect a rating from 0-100 on the intensity related to that variable
3530

36-
**The Research Question:** "Do students who have a roommate report different levels of daytime sleepiness compared to students who do not have a roommate?"
31+
- `danceability_%`
32+
- `valence_%`
33+
- `energy_%`
34+
- `acousticness_%`
35+
- `instrumentalness_%`
36+
- `liveness_%`
37+
- `speechiness_%`
3738

38-
**Your Steps:**
39+
------------------------------------------------------------------------
3940

40-
1. **Identify & Model:**
41+
## Lab Exercises
4142

42-
- What is the predictor (IV) and what is the outcome (DV)?
43+
Import your data and use the `clean_names()` function to make the variables a little nicer looking
4344

44-
- Are they categorical or continuous?
45+
## Task 1 - Correlation table
4546

46-
- Based on this, what is the appropriate model family? Write out the model in R formula syntax (`outcome ~ predictor`).
47-
48-
2. **Describe & Visualize:**
49-
50-
- Calculate the mean and standard deviation of `ess_score` for both groups (those with and without a roommate).
51-
52-
- Create a boxplot to visualize the distribution of `ess_score` for each group. Make sure your plot is clearly labeled.
47+
Start by creating a correlation table (make sure it looks nice and not just an output from R using `cor()`).
5348

5449
```{r}
55-
## Describe your data. Look back to past labs where there was a group_by() and then summarize() type of function
56-
57-
58-
59-
60-
## We also created some boxplots before
61-
6250
6351
```
6452

65-
3. **Analyze:**
66-
67-
- Run the appropriate statistical test in R to determine if there is a significant difference between the groups.
68-
69-
```{r}
70-
## Conduct your analysis
71-
72-
73-
```
53+
Examine the correlation table and identify the two largest effects with the outcome (`streams`).
7454

75-
4. **Interpret & Conclude:**
55+
## Task 2 - Visualize Relationships
7656

77-
- What is the p-value from your test?
57+
Visualize the two correlations that you have identified.
7858

79-
- Based on the test and your descriptive statistics, write a one-sentence conclusion that directly answers the research question.
80-
81-
- **Critical Thinking:** This is an observational study. Can you conclude that having a roommate *causes* a change in sleepiness? Why or why not?
82-
83-
## Bonus: Sleep Habits and Age (An Association)
84-
85-
This question is not required. But you will get some bonus points if you decide to do it!
86-
87-
**The Research Question:** "Is there an association between a student's sleep habits and their age?"
88-
89-
**Your Steps:**
90-
91-
1. **Identify & Model:**
92-
93-
- What is the predictor (IV) and what is the outcome (DV)?
94-
95-
- Are they categorical or continuous?
96-
97-
- Based on this, what is the appropriate model family? Write out the model in R formula syntax.
98-
99-
2. **Visualize:**
100-
101-
- Create a scatterplot to visualize the relationship between `ashs_score` (sleep habits) and `age`.
102-
103-
- Add a line of best fit to the plot. Make sure your plot is clearly labeled.
104-
105-
3. **Analyze:**
106-
107-
- Run the appropriate statistical test in R to determine if there is a significant association between the two variables.
59+
```{r}
10860
109-
4. **Interpret & Conclude:**
61+
```
11062

111-
- What is the correlation coefficient (`r`) and the p-value from your test?
63+
## Task 3 - APA Writeup
11264

113-
- Based on these results, write a one-sentence conclusion that describes the nature and significance of the relationship.
65+
Choose one of the relationships that you visualized and write the results in APA format.
11466

11567
*End of Lab. Don't forget to Knit! 🧶*

0 commit comments

Comments
 (0)