Introduction

In 2020 global music industry revenue amounted to over $54 billion [1]. Young adults contribute to a big share of this market, as most of them report that they listen to music every day. Moreover, many of them claim that they cannot be happy without music [2]. This is why understanding and exploring music preferences of young people is an interesting and important issue. The main goal of this article is to explore young adults’ music preferences using associations rules. In particular, the goal was to answer the following research questions:
- What type of young adults like listening to music?
- What are the associations between music genres people like to listen to?
- What are the associations between music genres people do not like to listen to?
- What personality traits make people like listening to Music and what personality traits people who like listening to music tend to have?
Apriori algorithm was used to generate association rules. It uses prior knowledge of frequent items and focuses on them.

Data description

The data used for this analysis comes from a survey conducted in 2013 by students of the Statistics class at Faculty of Social and Economic Sciences, Comenius University Bratislava. They interviewed 1010 Slovakian teenagers and young adults and asked them set of questions related to, among others, their music preferences, hobby and interests, personality traits and demographics. This dataset is available on Kaggle (https://www.kaggle.com/miroslavsabo/young-people-survey) and to my best knowledge has not yet been analyzed using association rules.

Analysis

What type of young adults like listening to music?

From the preliminary data analysis, we learn that most of respondents are aged 19-22. Most of them have spent most of their childhood in a city, have siblings and have graduated secondary school. 94% of them like listening to music.

itemFrequency(trans_dem, type="relative")[which(itemFrequency(trans_dem, type="relative") > 0.00103)]
##                            15-18                            19-22 
##                      0.213197970                      0.615228426 
##                            23-26                            27-30 
##                      0.119796954                      0.050761421 
##                   block of flats                             city 
##                      0.591878173                      0.703553299 
##          college/bachelor degree currently a primary school pupil 
##                      0.211167513                      0.010152284 
##                    dislike music                 doctorate degree 
##                      0.019289340                      0.005076142 
##                           female                    have siblings 
##                      0.587817259                      0.748223350 
##                   house/bungalow                       like music 
##                      0.407106599                      0.943147208 
##                             male                   masters degree 
##                      0.411167513                      0.077157360 
##                neutral for music                       only child 
##                      0.036548223                      0.250761421 
##                   primary school                 secondary school 
##                      0.075126904                      0.620304569 
##                          village 
##                      0.295431472

We see that young adults who like listening to music are often teenagers aged 15-18, still in primary school and living most of their childhood in a village.

# What type of young adults like listening to music?
rules.like.music <- apriori(data=trans_dem, parameter=list(supp=0.01, conf=0.1), appearance=list(default="lhs", rhs="like music"), control=list(verbose=F)) 
rules.like.music.conf <- sort(rules.like.music, by="confidence", decreasing=TRUE)
inspect(head(rules.like.music.conf)) 
##     lhs                                        rhs          support   
## [1] {27-30, male, masters degree}           => {like music} 0.01319797
## [2] {15-18, only child, primary school}     => {like music} 0.01522843
## [3] {15-18, primary school, village}        => {like music} 0.01928934
## [4] {15-18, female, primary school}         => {like music} 0.04568528
## [5] {15-18, block of flats, primary school} => {like music} 0.04162437
## [6] {female, primary school, village}       => {like music} 0.01421320
##     confidence coverage   lift    count
## [1] 1          0.01319797 1.06028 13   
## [2] 1          0.01522843 1.06028 15   
## [3] 1          0.01928934 1.06028 19   
## [4] 1          0.04568528 1.06028 45   
## [5] 1          0.04162437 1.06028 41   
## [6] 1          0.01421320 1.06028 14

What are the associations between music genres people like to listen to?

From the relative frequency plot, we see that most people like Rock and Pop – both of them have relative frequency of over 50%. On the other hand, least liked music genres are Folk and Country.

itemFrequencyPlot(genre_like)

There are many interesting rules regarding music genre preferences, for example:
- People who like Classical music and Rock and Roll are also likely to likely to like Swing and Jazz – it might be due to all those genres being more popular in past decades.
- People who like Classical music also like Opera – which both are rather “conservative” music genres.
- Listening to Metal or Hardrock, Punk, Rock and Roll and Alternative makes one more likely to enjoy Rock – which is expected, as all those genres are similar and might overlap.

plot(genre_like_rules)

plot(genre_like_rules, method="grouped")

plot(genre_like_rules, method="paracoord", control=list(reorder=TRUE))

inspect(sort(genre_like_rules, by = "lift")[1:5])
##     lhs                                     rhs               support  
## [1] {Classical.music}                    => {Opera}           0.1271368
## [2] {Opera}                              => {Classical.music} 0.1271368
## [3] {Classical.music, Rock, Rock.n.roll} => {Swing..Jazz}     0.1057692
## [4] {Classical.music, Rock.n.roll}       => {Swing..Jazz}     0.1217949
## [5] {Reggae..Ska, Rock}                  => {Punk}            0.1047009
##     confidence coverage  lift     count
## [1] 0.3765823  0.3376068 2.430904 119  
## [2] 0.8206897  0.1549145 2.430904 119  
## [3] 0.6875000  0.1538462 2.298214  99  
## [4] 0.6705882  0.1816239 2.241681 114  
## [5] 0.5077720  0.2061966 2.200345  98
inspect(sort(genre_like_rules, by = "confidence")[1:5])
##     lhs                                     rhs    support   confidence
## [1] {Metal.or.Hardrock, Punk}            => {Rock} 0.1100427 0.9626168 
## [2] {Metal.or.Hardrock, Rock.n.roll}     => {Rock} 0.1346154 0.9545455 
## [3] {Alternative, Punk}                  => {Rock} 0.1207265 0.9495798 
## [4] {Punk, Rock.n.roll}                  => {Rock} 0.1292735 0.9453125 
## [5] {Classical.music, Metal.or.Hardrock} => {Rock} 0.1079060 0.9351852 
##     coverage  lift     count
## [1] 0.1143162 1.516851 103  
## [2] 0.1410256 1.504132 126  
## [3] 0.1271368 1.496308 113  
## [4] 0.1367521 1.489583 121  
## [5] 0.1153846 1.473625 101
inspect(sort(genre_like_rules, by = "count")[1:5])
##     lhs              rhs           support   confidence coverage  lift     
## [1] {Rock.n.roll} => {Rock}        0.3365385 0.8377660  0.4017094 1.3201161
## [2] {Rock}        => {Rock.n.roll} 0.3365385 0.5303030  0.6346154 1.3201161
## [3] {Pop}         => {Rock}        0.3311966 0.6262626  0.5288462 0.9868381
## [4] {Rock}        => {Pop}         0.3311966 0.5218855  0.6346154 0.9868381
## [5] {Dance}       => {Pop}         0.2713675 0.7277937  0.3728632 1.3761917
##     count
## [1] 315  
## [2] 315  
## [3] 310  
## [4] 310  
## [5] 254
inspect(sort(genre_like_rules, by = "support")[1:5])
##     lhs              rhs           support   confidence coverage  lift     
## [1] {Rock.n.roll} => {Rock}        0.3365385 0.8377660  0.4017094 1.3201161
## [2] {Rock}        => {Rock.n.roll} 0.3365385 0.5303030  0.6346154 1.3201161
## [3] {Pop}         => {Rock}        0.3311966 0.6262626  0.5288462 0.9868381
## [4] {Rock}        => {Pop}         0.3311966 0.5218855  0.6346154 0.9868381
## [5] {Dance}       => {Pop}         0.2713675 0.7277937  0.3728632 1.3761917
##     count
## [1] 315  
## [2] 315  
## [3] 310  
## [4] 310  
## [5] 254

I also analyzed what people are most likely to listen to if they enjoy listening to Alternative music. We see that people who like Punk, Rock, Rock and Roll, Swing and Jazz tend to also listen to Alternative music.

##     lhs                     rhs              support confidence   coverage     lift count
## [1] {Punk,                                                                               
##      Rock.n.roll,                                                                        
##      Swing..Jazz}        => {Alternative} 0.05235043  0.7656250 0.06837607 2.349590    49
## [2] {Punk,                                                                               
##      Rock,                                                                               
##      Rock.n.roll,                                                                        
##      Swing..Jazz}        => {Alternative} 0.05021368  0.7580645 0.06623932 2.326388    47
## [3] {Punk,                                                                               
##      Rock,                                                                               
##      Swing..Jazz}        => {Alternative} 0.05662393  0.7464789 0.07585470 2.290834    53
## [4] {Punk,                                                                               
##      Swing..Jazz}        => {Alternative} 0.05876068  0.7432432 0.07905983 2.280904    55
## [5] {Metal.or.Hardrock,                                                                  
##      Punk,                                                                               
##      Rock,                                                                               
##      Rock.n.roll}        => {Alternative} 0.05128205  0.7164179 0.07158120 2.198581    48
## [6] {Metal.or.Hardrock,                                                                  
##      Punk,                                                                               
##      Rock.n.roll}        => {Alternative} 0.05341880  0.7142857 0.07478632 2.192037    50

What are the associations between music genres people like to listen to?

From the relative frequency plot, we see that the most dislike music genres are Country and Opera, followed by Folk, Metal or Hardrock and Punk.

itemFrequencyPlot(genre_dislike)

We see for example that: - People who dislike Pop music, also tend to dislike other “dancy” genres such as Dance and Latino. - People who dislike Classical music often also dislike Opera. - People who dislike Opera or Country tend to dislike Folk and vice versa.

rules_alternative <- apriori(data=genre_like, parameter=list(supp=0.05,conf = 0.01), 
                       appearance=list(default="lhs", rhs="Alternative"), control=list(verbose=F)) 
rules_alternative_conf <- sort(rules_alternative, by="confidence", decreasing=TRUE)
inspect(head(rules_alternative_conf))
##     lhs                     rhs              support confidence   coverage     lift count
## [1] {Punk,                                                                               
##      Rock.n.roll,                                                                        
##      Swing..Jazz}        => {Alternative} 0.05235043  0.7656250 0.06837607 2.349590    49
## [2] {Punk,                                                                               
##      Rock,                                                                               
##      Rock.n.roll,                                                                        
##      Swing..Jazz}        => {Alternative} 0.05021368  0.7580645 0.06623932 2.326388    47
## [3] {Punk,                                                                               
##      Rock,                                                                               
##      Swing..Jazz}        => {Alternative} 0.05662393  0.7464789 0.07585470 2.290834    53
## [4] {Punk,                                                                               
##      Swing..Jazz}        => {Alternative} 0.05876068  0.7432432 0.07905983 2.280904    55
## [5] {Metal.or.Hardrock,                                                                  
##      Punk,                                                                               
##      Rock,                                                                               
##      Rock.n.roll}        => {Alternative} 0.05128205  0.7164179 0.07158120 2.198581    48
## [6] {Metal.or.Hardrock,                                                                  
##      Punk,                                                                               
##      Rock.n.roll}        => {Alternative} 0.05341880  0.7142857 0.07478632 2.192037    50
plot(rules_alternative, method="paracoord", control=list(reorder=TRUE))

What personality traits make people like listening to Music and what personality traits people who like listening to music tend to have?

As it was mentioned before, 94% of survey participants like listening to music. Other popular personality traits among respondents were: often keeping promises (Keeping.Promises), turning back borrowed stuff (Hypochondriac) and not being hypochondriac.

itemFrequencyPlot(like_music, topN = 10)

We see that people who believe that bad people will suffer one day and good people will be rewarded (Final.Judgment) and people who feel lonely (Loneliness) tend to like listening to music.
On the opposite, people who listen to music tend to keep their promises (Keeping.Promises), be not hypochondriac (Hypochondriac) and turn back borrowed stuff (Borrowed.Stuff). This overlaps with most frequent answers, as because all of them appear rather frequently, they have high support and high confidence.

rules_like_music_personality <- apriori(data=like_music, parameter=list(supp=0.1,conf = 0.25), 
                       appearance=list(default="lhs", rhs="like Music"), control=list(verbose=F)) 
rules_like_music_personality_conf <- sort(rules_like_music_personality, by="confidence", decreasing=TRUE)
inspect(head(rules_like_music_personality_conf))
##     lhs                            rhs            support confidence  coverage    lift count
## [1] {Final.judgement,                                                                       
##      Funniness}                 => {like Music} 0.1125290          1 0.1125290 1.05122    97
## [2] {Final.judgement,                                                                       
##      not Prioritising.workload} => {like Music} 0.1113689          1 0.1113689 1.05122    96
## [3] {Assertiveness,                                                                         
##      Loneliness}                => {like Music} 0.1322506          1 0.1322506 1.05122   114
## [4] {Knowing.the.right.people,                                                              
##      Loneliness}                => {like Music} 0.1438515          1 0.1438515 1.05122   124
## [5] {Decision.making,                                                                       
##      i am often running late}   => {like Music} 0.1102088          1 0.1102088 1.05122    95
## [6] {Finding.lost.valuables,                                                                
##      not Getting.angry}         => {like Music} 0.1055684          1 0.1055684 1.05122    91
rules_like_music_personality_rev <- apriori(data=like_music, parameter=list(supp=0.1,conf = 0.25), 
                                        appearance=list(default="rhs", lhs="like Music"), control=list(verbose=F)) 
rules_like_music_personality_rev_conf <- sort(rules_like_music_personality_rev, by="confidence", decreasing=TRUE)
inspect(head(rules_like_music_personality_rev_conf))
##     lhs             rhs                support   confidence coverage  lift    
## [1] {like Music} => {Keeping.promises} 0.7134571 0.7500000  0.9512761 1.005443
## [2] {like Music} => {not Hypochondria} 0.7111369 0.7475610  0.9512761 1.010028
## [3] {}           => {Keeping.promises} 0.7459397 0.7459397  1.0000000 1.000000
## [4] {like Music} => {Borrowed.stuff}   0.7088167 0.7451220  0.9512761 1.006732
## [5] {}           => {not Hypochondria} 0.7401392 0.7401392  1.0000000 1.000000
## [6] {}           => {Borrowed.stuff}   0.7401392 0.7401392  1.0000000 1.000000
##     count
## [1] 615  
## [2] 613  
## [3] 643  
## [4] 611  
## [5] 638  
## [6] 638

Summary

In this article, I used apriori algorithm to find association rules in order to explore music preferences of young adults. Using association rules enabled us to see profiles of young adults who like listening to music, make connections between their liked and disliked genres as well as learn personality traits which drive people to listen to music.

References

[1] https://www.globenewswire.com/news-release/2021/09/16/2298162/28124/en/Global-Music-Recording-Market-Report-2021-2030-Featuring-Universal-Music-Group-Sony-Music-and-Warner-Music.html
[2] Upadhyay, Dr. Durgesh. (2014). Young Adults, Music and Psychological Well-Being: Exploring the Prospects. 2. 37-43.