This dataset delves into the relationship between music and its impact on mental well-being. It includes columns that provide information on individuals’ music preferences and whether they perceive any influence on their mental state. As I approach this dataset, I aim to explore the following questions: Does the tempo (bpm) of the music being listened to have an impact on mental health? What age demographics are engaged with this music? And is there a connection between the duration of music listening and mental health?
setwd("C:/Users/janet/Donloads/archive")
read.data <- read.csv("mxmh_survey_results.csv")
The histogram exhibits a rightward skew, indicating that a larger portion of the population listens to a relatively lower amount of music daily compared to those who engage in longer music listening sessions. ## Hours Spent Listening To Music Plot
hist(read.data$Hours.per.day, xlab="Hours Listened",main="Hours Spent Listening To Music", col="green")
The box plot exhibits a rightward skew, signifying that there is a larger representation of younger individuals in the survey who are willing to discuss their mental health, while the participation from older age groups is comparatively lower. ## Age Range of Those Being Surveyed Plot
boxplot(read.data$Age, main="Age Range", ylab="Age", col="red")
The histogram illustrates a normal distribution, indicating that the majority of music listeners have a preference for music within a similar range of beats per minute (bpm). ## BPM of Favorite Genre Plot
bpm <- as.factor(read.data$BPM)
hist(as.numeric(bpm), main="BPM of Favorite Genre", xlab="BPM", col="cyan")
These calculations provide statistics such as the mean, median, standard deviation, and more for the ages of the individuals included in the survey. ## Statistical Calculations on Hours listened per day
mean(read.data$Hours.per.day)
sd(read.data$Hours.per.day)
median(read.data$Hours.per.day)
min(read.data$Hours.per.day)
max(read.data$Hours.per.day)
I conducted separate t-tests on the data I wanted to explore further, enabling me to make meaningful comparisons between them.This process will contribute to enhancing my comprehension of how music influences mental health. ## T-Test on Hours listened per day
t.test(read.data$Hours.per.day, mu=3)
t.test(read.data$BPM, mu=130)
t.test(read.data$Age, mu=20)