Hypothesis:
H0: There is no relationship between time spent in the shop Minutes and the number of drinks purchased (Drinks).
H1: There is a positive relationship between time spent in the shop Minutes and the number of drinks purchased (Drinks).
library(readxl)
dataset <- read_excel("/Users/sharmilaakula/Downloads/OneDrive_2_11-14-2025/A5RQ1.xlsx")
library(psych)
describe(dataset[, c("Minutes", "Drinks")])
## vars n mean sd median trimmed mad min max range skew kurtosis
## Minutes 1 461 29.89 18.63 24.4 26.99 15.12 10 154.2 144.2 1.79 5.20
## Drinks 2 461 3.00 1.95 3.0 2.75 1.48 0 17.0 17.0 1.78 6.46
## se
## Minutes 0.87
## Drinks 0.09
hist(dataset$Minutes,
main = "Histogram of Minutes",
xlab = "Value",
ylab = "Frequency",
col = "lightblue",
border = "black",
breaks = 20)
hist(dataset$Drinks,
main = "Histogram of Drinks",
xlab = "Value",
ylab = "Frequency",
col = "lightgreen",
border = "black",
breaks = 20)
shapiro.test(dataset$Minutes)
##
## Shapiro-Wilk normality test
##
## data: dataset$Minutes
## W = 0.84706, p-value < 2.2e-16
shapiro.test(dataset$Drinks)
##
## Shapiro-Wilk normality test
##
## data: dataset$Drinks
## W = 0.85487, p-value < 2.2e-16
library(ggplot2)
##
## Attaching package: 'ggplot2'
## The following objects are masked from 'package:psych':
##
## %+%, alpha
library(ggpubr)
ggscatter(dataset, x = "Minutes", y = "Drinks",
add = "reg.line",
conf.int = TRUE,
cor.coef = TRUE,
cor.method = "pearson",
xlab = "Minutes", ylab = "Drinks")
cor.test(dataset$Minutes, dataset$Drinks, method = "pearson")
##
## Pearson's product-moment correlation
##
## data: dataset$Minutes and dataset$Drinks
## t = 68.326, df = 459, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.9452363 0.9617123
## sample estimates:
## cor
## 0.9541922
Review Your Output
Name of test: Spearman Correlation
Variables: Minutes and Drinks
Total sample size (n): 461
Statistically significant? Yes
Mean and SD:Minutes: M = 29.89, SD = 18.63 Drinks: M = 3.00, SD = 1.95
Direction and size: Positive and Strong
Degrees of freedom (df): Not applicable
rho-value: 0.92
EXACT p-value: p < .001
FINAL REPORT
A Spearman correlation was conducted to assess the relationship between the time spent in the shop (Minutes) and the number of drinks purchased (Drinks) (n = 461). There was a statistically significant correlation between time spent (M = 29.89, SD = 18.63) and drinks purchased (M = 3.00, SD = 1.95). The correlation was positive and strong, rho = 0.92, p < .001. As time spent in the shop increases, the number of drinks purchased also increases.