Hypothesis:
H0: There is no relationship between the number of (laptops) purchased and the number of anti-virus licenses purchased.
H1: There is a positive relationship between the number of (laptops) purchased and the number of anti-virus licenses purchased.
library(readxl)
dataset <- read_excel("/Users/sharmilaakula/Downloads/OneDrive_2_11-14-2025/A5RQ2.xlsx")
library(psych)
describe(dataset[, 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(dataset$Antivirus,
main = "Histogram of Antivirus",
xlab = "Value",
ylab = "Frequency",
col = "lightblue",
border = "black",
breaks = 20)
hist(dataset$Laptop,
main = "Histogram of Laptop",
xlab = "Value",
ylab = "Frequency",
col = "lightgreen",
border = "black",
breaks = 20)
shapiro.test(dataset$Antivirus)
##
## Shapiro-Wilk normality test
##
## data: dataset$Antivirus
## W = 0.99419, p-value = 0.8981
shapiro.test(dataset$Laptop)
##
## Shapiro-Wilk normality test
##
## data: dataset$Laptop
## W = 0.99362, p-value = 0.8559
library(ggplot2)
##
## Attaching package: 'ggplot2'
## The following objects are masked from 'package:psych':
##
## %+%, alpha
library(ggpubr)
ggscatter(dataset, x = "Antivirus", y = "Laptop",
add = "reg.line",
conf.int = TRUE,
cor.coef = TRUE,
cor.method = "pearson",
xlab = "Antivirus", ylab = "Laptop")
cor.test(dataset$Antivirus, dataset$Laptop, method = "pearson")
##
## Pearson's product-moment correlation
##
## data: dataset$Antivirus and dataset$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
Review Your Output
Name of test: Pearson Correlation
Variables: Antivirus and Laptop
Total sample size (n): 122
Statistically significant? Yes
Mean and SD:Antivirus: M = 50.18, SD = 13.36 Laptop: M = 40.02, SD = 12.30
Direction and size: Positive and Strong
Degrees of freedom (df): 120
r-value: 0.92
EXACT p-value: p < .0012)
Final Report
A Pearson correlation was conducted to examine the relationship between anti-virus software purchases and laptop purchases (n = 122). There was a statistically significant correlation between anti-virus software (M = 50.18, SD = 13.36) and laptop purchases (M = 40.02, SD = 12.30). The correlation was positive and strong, r(120) = 0.92, p < .001. As anti-virus software purchases increase, laptop purchases also increase.