QUESTION
What are the null and alternate hypotheses for your research?
H0: “There is no relationship between time spent in the café and
number of drinks purchased.”
H1: “There is a relationship between time spent in the café and
number of drinks purchased.”
install.packages(“readxl”) library(readxl) A5RQ1 <-
read_excel(“C:\Users\manit\OneDrive\Desktop\A5RQ1.xlsx”) head(A5RQ1)
install.packages(“psych”) library(psych) # CALCULATE THE DESCRIPTIVE
DATA describe(A5RQ1[, c(“Minutes”, “Drinks”)])
===============================================
CHECK THE NORMALITY OF THE CONTINUOUS VARIABLES
===============================================
hist(A5RQ1$Minutes, main = “Histogram of Minutes”, xlab = “Value”,
ylab = “Frequency”, col = “lightblue”, border = “black”, breaks =
20)
hist(A5RQ1$Drinks, main = “Histogram of Drinks”, xlab = “Value”, ylab
= “Frequency”, col = “lightgreen”, border = “black”, breaks = 20)
QUESTION
Q1) Check the SKEWNESS of the VARIABLE 1 histogram. In your opinion,
does the histogram look symmetrical, positively skewed, or negatively
skewed?
#Ans) The histogram for Minutes is positively skewed (right-skewed).
# Q2) Check the KURTOSIS of the VARIABLE 1 histogram. In your opinion,
does the histogram look too flat, too tall, or does it have a proper
bell curve? #Ans) The distribution looks too tall and peaked, not like a
normal bell curve. It has a leptokurtic shape. # Q3) Check the SKEWNESS
of the VARIABLE 2 histogram. In your opinion, does the histogram look
symmetrical, positively skewed, or negatively skewed? # Ans) The
histogram for Drinks is also positively skewed (right-skewed). # Q4)
Check the KUROTSIS of the VARIABLE 2 histogram. In your opinion, does
the histogram look too flat, too tall, or does it have a proper bell
curve? # Ans) The distribution is tall and peaked, not a normal bell
curve.
shapiro.test(A5RQ1\(Minutes)
shapiro.test(A5RQ1\)Drinks)
QUESTION
Was the data normally distributed for Variable 1?
Ans) No. The Shapiro-Wilk test for Minutes produced a p-value <
.05, indicating that Variable 1 (Minutes) is NOT normally
distributed.
Was the data normally distributed for Variable 2?
Ans) No. The Shapiro-Wilk test for Drinks also produced a p-value
< .05, indicating that Variable 2 (Drinks) is NOT normally
distributed.
install.packages(“ggplot2”) install.packages(“ggpubr”)
library(ggplot2) library(ggpubr)
ggscatter(A5RQ1, x = “Minutes”, y = “Drinks”, add = “reg.line”,
conf.int = TRUE, cor.coef = TRUE, cor.method = “spearman”, xlab =
“Variable Minutes”, ylab = “Variable Drinks”)
QUESTION
Is the relationship positive (line pointing up), negative (line
pointing down), or is there no relationship (line is flat)?
Ans) The relationship is positive. The line is clearly pointing
upward, showing that as Minutes increases,the number of Drinks also
increases.
cor.test(A5RQ1\(Minutes,
A5RQ1\)Drinks, method = “spearman”)
Q1) What is the direction of the effect?
Ans) The effect is positive. As Minutes increases, the number of
Drinks also increases. The rho value is positive (0.92), indicating a
strong upward relationship.
Q2) What is the size of the effect?
Ans) The effect size is strong. A rho value of 0.92 falls in the
+or-0.50 to 1.00 range, which indicates a strong relationship between
the variables.
========================================================
>> WRITTEN REPORT FOR SPEARMAN CORRELATION <<
========================================================
A Spearman correlation was conducted to examine the relationship
between time spent in the café (minutes) and number of drinks purchased
(n = [INSERT SAMPLE SIZE]). The results showed a statistically
significant relationship between the two variables, p < .001. Time
spent in the café had a mean of [M1] minutes (SD = [SD1]), and the
number of drinks purchased had a mean of [M2] drinks (SD = [SD2]). The
correlation was positive and strong, ρ = 0.92, indicating that customers
who stayed longer in the café tended to purchase more drinks.