Friday The 13th

Author

Walter Hinkley

Friday the 13th: Does it influence us?

I love Friday the 13th!! The day, the movies, and the mystery around it. My wife also shared this mentality with me. So much so that we got married on Friday the 13th. We floated a Jason mask in the reflecting pond and our wedding was at the Ceresville Mansion(supposedly haunted). However, not everyone has the admiration for this day like I do. We have often heard people say “UH OH, its Friday the 13th, be careful”. But, does this supposed unlucky day actually change our behavior? The data set I have found looks into this very issue. With multiple daily activities we will see if behavior is changed. The behaviors that are examined in this data set are traffic, shopping, and accidents. For traffic, the researchers obtained information from the British Department of Transport regarding the traffic flows between junctions 7 to 8 and junctions 9 to 10 of the M25 motorway. For shopping, they collected the numbers of shoppers in nine different supermarkets in southeast England. For accidents, they collected numbers of emergency admissions to hospital due to transport accidents.

With our Data set we will compare the 3 types of activities on multiple Friday the 13th’s vs Friday the 6th’s. We will plot 6 lines, 3 on Friday the 13th and 3 on the 6th. Will there be a change if so then behavior has changed and we might need to explore this theory deeper.

#1 Set working directory, load libraries, and load data set

setwd("~/Desktop/Data Science 101")
#install.packages("audio")
#install.packages("jpeg")
#install.packages("ggpubr")
library(tuneR)
library(audio)

Attaching package: 'audio'
The following object is masked from 'package:tuneR':

    play
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.5.1     ✔ tibble    3.2.1
✔ lubridate 1.9.3     ✔ tidyr     1.3.1
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(ggplot2)
library(ggpubr)
library(jpeg)
options(repos = c(CRAN = "https://cran.rstudio.com/")) 
fri <- read_csv('friday.csv')
Rows: 61 Columns: 6
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (3): type, date, location
dbl (3): sixth, thirteenth, diff

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

Attatch Sound file to document

setwd("~/Desktop/Data Science 101")
readMP3("chchahah.mp3")

Wave Object
    Number of Samples:      182016
    Duration (seconds):     4.13
    Samplingrate (Hertz):   44100
    Channels (Mono/Stereo): Stereo
    PCM (integer format):   TRUE
    Bit (8/16/24/32/64):    16 
mp3_file <- "chchahah.mp3"
play(mp3_file)
# Specify the path to your MP3 file
mp3_file <- "chchahah.mp3"

# Play the audio file
play(mp3_file,)

I have tried multiple ways to get the sound byte to play but have not had success. The code goes through but it still does not play the file. I will work more on this to hopefully get a result.

display structure of fri data set

structure(fri)
# A tibble: 61 × 6
   type    date              sixth thirteenth  diff location
   <chr>   <chr>             <dbl>      <dbl> <dbl> <chr>   
 1 traffic 1990,  July      139246     138548   698 7 to 8  
 2 traffic 1990,  July      134012     132908  1104 9 to 10 
 3 traffic 1991,  September 137055     136018  1037 7 to 8  
 4 traffic 1991,  September 133732     131843  1889 9 to 10 
 5 traffic 1991,  December  123552     121641  1911 7 to 8  
 6 traffic 1991,  December  121139     118723  2416 9 to 10 
 7 traffic 1992,  March     128293     125532  2761 7 to 8  
 8 traffic 1992,  March     124631     120249  4382 9 to 10 
 9 traffic 1992,  November  124609     122770  1839 7 to 8  
10 traffic 1992,  November  117584     117263   321 9 to 10 
# ℹ 51 more rows

Create first data frame for traffic

tra <- fri[1:10,1:4]
tra
# A tibble: 10 × 4
   type    date              sixth thirteenth
   <chr>   <chr>             <dbl>      <dbl>
 1 traffic 1990,  July      139246     138548
 2 traffic 1990,  July      134012     132908
 3 traffic 1991,  September 137055     136018
 4 traffic 1991,  September 133732     131843
 5 traffic 1991,  December  123552     121641
 6 traffic 1991,  December  121139     118723
 7 traffic 1992,  March     128293     125532
 8 traffic 1992,  March     124631     120249
 9 traffic 1992,  November  124609     122770
10 traffic 1992,  November  117584     117263

Create Five Number Summaries for Traffic (6th and 13th)

data1 <- tra$sixth
fivenum(data1)
[1] 117584 123552 126462 134012 139246
data2 <- tra$thirteenth
fivenum(data2)
[1] 117263 120249 124151 132908 138548

Create a percentage change in traffic from the 6th to the 13th

sum(124151 - 126464)/124151 * 100
[1] -1.863054

Create traffic boxplots comparing the 6th to the 13th

img1 <- readJPEG("fri2.jpg")
tral <- tra |>
  pivot_longer(
    cols = 3:4,
    names_to ="days",
    values_to ="travelers")
ggplot(tral, aes(x=days, y = travelers))+
  background_image(img1)+
  geom_boxplot(color = "red", alpha = .2,)+
  geom_dotplot(binaxis = "y", stackdir = "center", color = "red", dotsize = 0.5)+
  theme_dark()+
  labs(x = "Day",
         y = "Number of Travelers",
         title = "Travel on Friday the 13th",
         caption = "https://www.openintro.org/data/index.php?data=friday")
Bin width defaults to 1/30 of the range of the data. Pick better value with
`binwidth`.

Create second data frame for shopping

shop <- fri[11:55, 1:4]
shop
# A tibble: 45 × 4
   type     date             sixth thirteenth
   <chr>    <chr>            <dbl>      <dbl>
 1 shopping 1990,  July       4942       4882
 2 shopping 1991,  September  4895       4736
 3 shopping 1991,  December   4805       4784
 4 shopping 1992,  March      4570       4603
 5 shopping 1992,  November   4506       4629
 6 shopping 1990,  July       6754       6998
 7 shopping 1991,  September  6704       6707
 8 shopping 1991,  December   5871       5662
 9 shopping 1992,  March      6026       6162
10 shopping 1992,  November   5676       5665
# ℹ 35 more rows

Create five number summaries for shopping (6th and 13th)

data3 <- shop$sixth
fivenum(data3)
[1] 3558 3954 4805 6026 7138
data4 <- shop$thirteenth
fivenum(data4)
[1] 3554 3926 4736 6162 7057

Create a percentage change in shopping from the 6th to the 13th

sum(4736 - 4805)/4736 * 100
[1] -1.456926

Create shopping Boxplots comparing the 6th to the 13th

img2 <- readJPEG("fri6.jpg")
shopl <- shop |>
  pivot_longer(
    cols = 3:4,
    names_to ="days",
    values_to ="shoppers")
ggplot(shopl, aes(x=days, y = shoppers))+
  background_image(img2)+
  geom_boxplot(color = "#fa8f02", alpha = .2,)+
  geom_dotplot(binaxis = "y", stackdir = "center", color = "#fa8f02",dotsize = 0.5)+
  theme_dark()+
  labs(x = "Day",
         y = "Number of Shoppers",
         title = "Shopping on Friday the 13th",
         caption = "https://www.openintro.org/data/index.php?data=friday")
Bin width defaults to 1/30 of the range of the data. Pick better value with
`binwidth`.

Create third data frame for accidents

acc <- fri[56:61, 1:4]
acc
# A tibble: 6 × 4
  type     date             sixth thirteenth
  <chr>    <chr>            <dbl>      <dbl>
1 accident 1989,  October       9         13
2 accident 1990,  July          6         12
3 accident 1991,  September    11         14
4 accident 1991,  December     11         10
5 accident 1992,  March         3          4
6 accident 1992,  November      5         12

Create the five number summaries for accidents

data5 <- acc$sixth
fivenum(data5)
[1]  3.0  5.0  7.5 11.0 11.0
data6 <- acc$thirteenth
fivenum(data6)
[1]  4 10 12 13 14

Create a percentage change in accidents from the 6th to the 13th

sum(12 - 7.5)/12 * 100
[1] 37.5

Create accident boxplots comparing 6th and 13th

img3 <- readJPEG("fri3.jpg")
accl <- acc |>
  pivot_longer(
    cols = 3:4,
    names_to ="days",
    values_to ="patients")
ggplot(accl, aes(x=days, y = patients))+
  background_image(img3)+
  geom_boxplot(color = "#fa8f02", alpha = .2,)+
  geom_dotplot(binaxis = "y", stackdir = "center", color = "#fa8f02", dotsize = 0.5)+
  theme_dark()+
  labs(x = "Day",
         y = "Number of Emergency Patients in Hospital",
         title = "Accidents on Friday The 13th",
         caption = "https://www.openintro.org/data/index.php?data=friday")
Bin width defaults to 1/30 of the range of the data. Pick better value with
`binwidth`.

Create Friday the 13th Summary

The data in this data set leans toward no impact or not significant as far as Friday the 13th having an effect on our behavior. For the daily mundane activities of traffic and shopping the change from the 6th to th 13th was minimal at best. However, when it came to emergency accidents there was a significant change of 37.5% more patients on the 13th. This could be because the supernatural has it out for us or that we change our behaviors and that in turn causes more accidents. With a change of behavior, we may be more susceptible to accidents since we are not staying in our normal routine. For further study, I would love to see many more years of data as well as more behaviours that are studied. Do people go out less on Friday evenings of Fri 13th, Do people visit cemeteries less on Fri 13th, Is there an uptick in horror movie viewers on a Fri 13th. All these would be potential variables that would give a sense of if we are changing our behavior due to a special(superstitious) day.

Resources

The source of this data set was found on openintro.org and comes from Scanlon, T.J., Luben, R.N., Scanlon, F.L., Singleton, N. (1993), “Is Friday the 13th Bad For Your Health?,” BMJ, 307, 1584-1586. https://dasl.datadescription.com/datafile/friday-the-13th-traffic and https://dasl.datadescription.com/datafile/friday-the-13th-accidents.

photo 1 https://www.google.com/url?sa=i&url=https%3A%2F%2Fmrwallpaper.com%2Ffriday-the-13th&psig=AOvVaw3IAokgNA4uQLk3ATOUgf2h&ust=1729712493040000&source=images&cd=vfe&opi=89978449&ved=0CBQQjRxqFwoTCNiDkbDfookDFQAAAAAdAAAAABAd from mrwallpaper.com

photo 2 https://halloween-year-round.com/2024/02/13/friday-the-13th-2009-is-still-a-solid-remake-15-years-later/ from F13TheGame

photo 3 https://www.google.com/url?sa=i&url=https%3A%2F%2Fpngtree.com%2Ffree-backgrounds-photos%2Ffriday-13th&psig=AOvVaw1s9vIg3fphC7AlkPR8aEmy&ust=1729715582844000&source=images&cd=vfe&opi=89978449&ved=0CBQQjRxqFwoTCOC3ve7qookDFQAAAAAdAAAAABAc from Pngtree