HYPOTHESES
QUESTION
What are the null and alternate hypotheses for your research?
H0:There is no relationship between time spent (minutes) in the shop and number of drinks purchased
H1:There is a relationship between time spent (minutes) in the shop and number of drinks purchased
library(readxl)
A5RQ1 <- read_excel("C:\\Users\\kuppi\\OneDrive\\Desktop\\A5RQ1.xlsx")
library(psych)
describe(A5RQ1[, 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(A5RQ1$Minutes,
main = "Histogram of V1",
xlab = "Value",
ylab = "Frequency",
col = "lightblue",
border = "black",
breaks = 20)
hist(A5RQ1$Drinks,
main = "Histogram of V2",
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?
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?
Q3) Check the SKEWNESS of the VARIABLE 2 histogram. In your opinion, does the histogram look symmetrical, positively skewed, or negatively 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?
shapiro.test(A5RQ1$Minutes)
##
## Shapiro-Wilk normality test
##
## data: A5RQ1$Minutes
## W = 0.84706, p-value < 2.2e-16
shapiro.test(A5RQ1$Drinks)
##
## Shapiro-Wilk normality test
##
## data: A5RQ1$Drinks
## W = 0.85487, p-value < 2.2e-16
QUESTION
Was the data normally distributed for Variable 1?
No, because p < 0.05
Was the data normally distributed for Variable 2?
No, because p < 0.05
library(ggplot2)
##
## Attaching package: 'ggplot2'
## The following objects are masked from 'package:psych':
##
## %+%, alpha
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)?
the relationship is positive
cor.test(A5RQ1$Minutes, A5RQ1$Drinks, method = "spearman")
## Warning in cor.test.default(A5RQ1$Minutes, A5RQ1$Drinks, method = "spearman"):
## Cannot compute exact p-value with ties
##
## Spearman's rank correlation rho
##
## data: A5RQ1$Minutes and A5RQ1$Drinks
## S = 1305608, p-value < 2.2e-16
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## 0.9200417
Q1) What is the direction of the effect?
Q2) What is the size of the effect?
A Spearman correlation was conducted to assess the relationship between Minutes and Drinks (n = 461).There was a statistically significant correlation between stress (M = 29.89, SD = 18.63) and sleep quality (M = 3.00, SD = 1.95).The correlation was positive and strong, ρ(459) = 0.9200417, p < 2.2e-16.As the number of Minutes increases, the number of drinks purchased decreases.