Is website browsing time associated with purchase amount?

Packages

library(readxl)
library(ggpubr)
## Loading required package: ggplot2

Import Data

FP2 <- read_excel("~/Library/CloudStorage/OneDrive-SaintLouisUniversity/AA-5221-12/Final Project/Pearson (or Spearman) Correlation/FP2.xlsx")

Scatterplot

ggscatter(
  FP2,
  x = "Browsing_Minutes",
  y = "Purchase_Amount",
  add = "reg.line"
)

# The relationship is approximately linear.
# The relationship is positive.
# There appear to be outliers.

Descriptive Statistics

mean(FP2$Browsing_Minutes)
## [1] 13.63775
sd(FP2$Browsing_Minutes)
## [1] 7.130587
median(FP2$Browsing_Minutes)
## [1] 11.595
mean(FP2$Purchase_Amount)
## [1] 67.18525
sd(FP2$Purchase_Amount)
## [1] 24.52695
median(FP2$Purchase_Amount)
## [1] 62.31

Histograms

hist(
  FP2$Browsing_Minutes,
  breaks = 15,
  col = "skyblue",
  border = "white"
)

# Data for Browsing_Minutes appears abnormally distributed.
hist(
  FP2$Purchase_Amount,
  breaks = 15,
  col = "firebrick",
  border = "white"
)

# Data for Purchase_Amount appears abnormally distributed.

Shapiro-Wilk

shapiro.test(FP2$Browsing_Minutes)
## 
##  Shapiro-Wilk normality test
## 
## data:  FP2$Browsing_Minutes
## W = 0.87528, p-value = 1.293e-08
# The variable Browsing_Minutes was abnormally distributed (p < .001).
shapiro.test(FP2$Purchase_Amount)
## 
##  Shapiro-Wilk normality test
## 
## data:  FP2$Purchase_Amount
## W = 0.93196, p-value = 1.278e-05
# The variable Purchase_Amount was abnormally distributed (p < .001).

Spearman Correlation

cor.test(
  FP2$Browsing_Minutes,
  FP2$Purchase_Amount,
  method = "spearman",
  exact = FALSE
)
## 
##  Spearman's rank correlation rho
## 
## data:  FP2$Browsing_Minutes and FP2$Purchase_Amount
## S = 179328, p-value = 2.158e-05
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
##       rho 
## 0.3772914
# A Spearman correlation was conducted to test the relationship between website browsing time (Mdn = 11.60) and purchase amount (Mdn = 62.31).
# There was a statistically significant relationship between the two variables, ρ = .38, p < .001.
# The relationship was positive and weak.