What are the null and alternate hypotheses for your research?
H0:There is no relationship between the number of laptops purchased and the number of antivirus licenses purchased
H1:There is a relationship between the number of laptops purchased and the number of antivirus licenses purchased
library(readxl)
A5RQ2 <- read_excel("C:\\Users\\kuppi\\OneDrive\\Desktop\\A5RQ2.xlsx")
library(psych)
describe(A5RQ2[, c("Antivirus", "Laptop")])
## vars n mean sd median trimmed mad min max range skew
## Antivirus 1 122 50.18 13.36 49 49.92 12.60 15 83 68 0.15
## Laptop 2 122 40.02 12.30 39 39.93 11.86 8 68 60 -0.01
## kurtosis se
## Antivirus -0.14 1.21
## Laptop -0.32 1.11
hist(A5RQ2$Antivirus,
main = "Histogram of Antivirus",
xlab = "Value",
ylab = "Frequency",
col = "lightblue",
border = "black",
breaks = 20)
hist(A5RQ2$Laptop,
main = "Histogram of Laptop",
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(A5RQ2$Antivirus)
##
## Shapiro-Wilk normality test
##
## data: A5RQ2$Antivirus
## W = 0.99419, p-value = 0.8981
shapiro.test(A5RQ2$Laptop)
##
## Shapiro-Wilk normality test
##
## data: A5RQ2$Laptop
## W = 0.99362, p-value = 0.8559
QUESTION
Was the data normally distributed for Variable 1?
YES because p-value = 0.8981, which is GREATER than .05
Was the data normally distributed for Variable 2?
YES because p-value = 0.8559, which is GREATER than .05
library(ggplot2)
##
## Attaching package: 'ggplot2'
## The following objects are masked from 'package:psych':
##
## %+%, alpha
library(ggpubr)
ggscatter(A5RQ2, x = "Antivirus", y = "Laptop",
add = "reg.line",
conf.int = TRUE,
cor.coef = TRUE,
cor.method = "pearson",
xlab = "Variable Antivirus", ylab = "Variable Laptop")
QUESTION
Is the relationship positive (line pointing up), negative (line pointing down), or is there no relationship (line is flat)?
The relationship is positive since the line is pointing up
cor.test(A5RQ2$Antivirus, A5RQ2$Laptop, method = "pearson")
##
## Pearson's product-moment correlation
##
## data: A5RQ2$Antivirus and A5RQ2$Laptop
## t = 25.16, df = 120, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.8830253 0.9412249
## sample estimates:
## cor
## 0.9168679
Q1) What is the direction of the effect?
Q2) What is the size of the effect?
A Pearson correlation was conducted to examine the relationship between Antivirus liscenses purchased and number of Laptops purchased (n = 122). There was a statistically significant correlation between Antivirus (M = 50.18, SD = 13.36) and Laptop (M = 40.02, SD = 12.30). The correlation was positive and strong, r(120) = 0.9168679, p < .001.As Antivirus liscenses purchases increases, number of Laptops purchased increases.