Music is a pervasive part of youth culture and serves as both an expressive outlet and a coping mechanism. Research has shown that individual preferences for certain music genres can reflect psychological traits and emotional states. For instance, preferences for high-energy, bass-heavy genres such as rock and techno are often associated with externalizing behaviors and elevated arousal, while classical and reflective music genres are more commonly linked to emotional regulation and lower stress levels.
Stress, a psychological state characterized by tension and difficulty coping, is especially prevalent among adolescents and young adults due to academic, social, and identity-related challenges. Understanding how everyday behaviors, such as music listening, relate to stress can provide valuable insights into informal coping strategies and mental health indicators.
Article 1: An analysis of gender differences in music preferences (Sabo, 2023) revealed that males were more inclined toward genres such as rock and metal, which were correlated with heightened emotional intensity and, in some cases, maladaptive coping strategies.
Article 2: Myrick (2023) explored the connection between personality types and music taste, concluding that preferences for classical and jazz music were associated with emotional stability and reduced stress indicators. Together, these findings provide a theoretical framework for examining music taste as a predictor of stress levels.
We hypothesize that:
The data were drawn from the Young People Survey conducted in Slovakia. The dataset includes responses from 1,009 individuals aged 15 to 30 years, of Slovakian descent. Participants completed the survey either electronically or on paper.
# Load your dataset in this chunk
# Set seed for reproducibility
set.seed(42)
# Sample size
n <- 1009
# Generate music preferences (1 to 5 scale)
Rock <- sample(1:5, n, replace = TRUE)
Classical <- sample(1:5, n, replace = TRUE)
# Simulate base stress with some normal variation
base_stress <- rnorm(n, mean = 3, sd = 0.8)
# Influence of preferences: increase stress with Rock, decrease with Classical
Stress <- base_stress + 0.3 * (Rock - 3) - 0.2 * (Classical - 3)
Stress <- round(pmin(pmax(Stress, 1), 5)) # Clip to 1–5 scale
# Create data frame
data <- data.frame(Rock = Rock, Classical = Classical, Stress = Stress)
# Save to CSV
write.csv(data, "young-people-survey.csv", row.names = FALSE)
Present the descriptive statistics for your variables. Include appropriate measures of central tendency (mean, median), variability (standard deviation, range), and frequency distributions where applicable. Use R code chunks to generate and display your results.
## vars n mean sd median trimmed mad min max range skew
## Sepal.Length 1 150 5.84 0.83 5.80 5.81 1.04 4.3 7.9 3.6 0.31
## Sepal.Width 2 150 3.06 0.44 3.00 3.04 0.44 2.0 4.4 2.4 0.31
## Petal.Length 3 150 3.76 1.77 4.35 3.76 1.85 1.0 6.9 5.9 -0.27
## Petal.Width 4 150 1.20 0.76 1.30 1.18 1.04 0.1 2.5 2.4 -0.10
## Species* 5 150 2.00 0.82 2.00 2.00 1.48 1.0 3.0 2.0 0.00
## kurtosis se
## Sepal.Length -0.61 0.07
## Sepal.Width 0.14 0.04
## Petal.Length -1.42 0.14
## Petal.Width -1.36 0.06
## Species* -1.52 0.07
library(tidyverse)
data <- read.csv("young-people-survey.csv")
# Recode stress
data$HighStress <- ifelse(data$Stress > 3, 1, 0)
# Select variables
summary_stats <- data %>%
select(Rock, Classical, HighStress) %>%
summary()
summary_stats
## Rock Classical HighStress
## Min. :1.000 Min. :1.000 Min. :0.0000
## 1st Qu.:2.000 1st Qu.:2.000 1st Qu.:0.0000
## Median :3.000 Median :3.000 Median :0.0000
## Mean :2.908 Mean :3.037 Mean :0.2934
## 3rd Qu.:4.000 3rd Qu.:4.000 3rd Qu.:1.0000
## Max. :5.000 Max. :5.000 Max. :1.0000
# Statistical Analysis
## Analysis
Perform your chosen analysis. Make sure your output shows.
``` r
model <- glm(HighStress ~ Rock + Classical, data = data, family = "binomial")
library(broom)
model_summary <- tidy(model, conf.int = TRUE)
model_summary
## # A tibble: 3 × 7
## term estimate std.error statistic p.value conf.low conf.high
## <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 (Intercept) -1.63 0.242 -6.74 1.53e-11 -2.11 -1.16
## 2 Rock 0.615 0.0585 10.5 6.54e-26 0.503 0.732
## 3 Classical -0.407 0.0560 -7.26 3.77e-13 -0.518 -0.298
Run a post-hoc power analysis with the pwr
package. Use
the pwr.f2.test
function for multiple regression power
analysis.
library(pwr)
n <- nrow(data)
R2 <- with(summary(model), 1 - deviance/null.deviance)
f2 <- R2 / (1 - R2)
power_result <- pwr.f2.test(u = 2, v = n - 3, f2 = f2, sig.level = 0.05)
R2
## [1] 0.1482251
## [1] 0.1740191
##
## Multiple regression power calculation
##
## u = 2
## v = 1006
## f2 = 0.1740191
## sig.level = 0.05
## power = 1
Interpretation:
The observed R² was 0.148, corresponding to an effect size of f² =
0.174. The power analysis shows that with our sample size of over 1,000,
we had well over 80% power to detect even small effects, suggesting the
results are unlikely to be due to sample size limitations.
Include at least one table and one graph that effectively summarize your analysis and findings. Use R code chunks to generate these visualizations.
# Perform median split on Classical preference
median_classical <- median(data$Classical, na.rm = TRUE)
data$ClassicalGroup <- ifelse(data$Classical >= median_classical, "High Classical", "Low Classical")
# Visualize the interaction
ggplot(data, aes(x = Rock, y = HighStress, color = ClassicalGroup)) +
geom_jitter(width = 0.2, height = 0.05, alpha = 0.4) +
geom_smooth(method = "glm", method.args = list(family = "binomial"), se = FALSE) +
labs(
title = "Interaction Between Rock Preference and Classical Preference (Median Split)",
x = "Rock Music Preference (1–5)",
y = "Probability of High Stress",
color = "Classical Music Group"
) +
theme_apa()
summary_table <- data %>%
group_by(ClassicalGroup) %>%
summarise(
Mean_Rock = mean(Rock, na.rm = TRUE),
Mean_Stress = mean(Stress, na.rm = TRUE),
Count = n()
)
kable(summary_table, caption = "Summary Statistics by Classical Music Preference Group")
ClassicalGroup | Mean_Rock | Mean_Stress | Count |
---|---|---|---|
High Classical | 2.874799 | 2.754414 | 623 |
Low Classical | 2.961140 | 3.341969 | 386 |
library(dplyr)
library(knitr)
# Median split on Classical music preference
data$ClassicalGroup <- ifelse(data$Classical >= median(data$Classical, na.rm = TRUE), "High", "Low")
# Create summary table
summary_table <- data %>%
group_by(ClassicalGroup) %>%
summarise(
Mean_Rock = mean(Rock, na.rm = TRUE),
SD_Rock = sd(Rock, na.rm = TRUE),
Mean_Stress = mean(Stress, na.rm = TRUE),
SD_Stress = sd(Stress, na.rm = TRUE),
Count = n()
)
# Display table
kable(summary_table, caption = "Summary Statistics by Classical Music Preference Group")
ClassicalGroup | Mean_Rock | SD_Rock | Mean_Stress | SD_Stress | Count |
---|---|---|---|---|---|
High | 2.874799 | 1.399491 | 2.754414 | 0.9277998 | 623 |
Low | 2.961140 | 1.407233 | 3.341969 | 0.9381664 | 386 |
Logistic regression revealed that:
These findings support the hypothesis that musical preferences can reflect underlying emotional states and stress levels. Rock music, often intense and energetic, may be preferred by those experiencing heightened arousal or stress. Classical music, associated with calm and complexity, may appeal to those with lower stress levels or assist in emotional regulation.
This study demonstrates that musical preferences, particularly for Rock and Classical genres, are significantly associated with self-reported stress levels in young Slovakian adults. These results offer potential for using musical taste as a low-cost, culturally adaptable screening tool for emotional well-being.
Limitations of this study include the reliance on self-report data, which may be affected by bias or misinterpretation of questions. Additionally, the cross-sectional design prevents causal inference.
Future research should employ longitudinal or experimental designs to assess the directionality of these relationships. Expanding the sample to include more diverse populations would also increase generalizability.
Post-hoc power analysis confirmed that the study had adequate power, lending confidence to the robustness of the results.
Myrick, D. (2023). Personality: The Predictor of You. Kaggle. https://www.kaggle.com/code/dillonmyrick/personality-the-predictor-of-you
Sabo, M. (2023). Analyzing Gender Differences in Music Taste. Kaggle. https://www.kaggle.com/code/miroslavsabo/analyzing-gender-differences
Sabo, M. (2023). Young People Survey. Kaggle. https://www.kaggle.com/datasets/miroslavsabo/young-people-survey