data<-read.csv("/Users/krishanbhalsod/Desktop/online_gaming_behavior_dataset.csv")
data$InGamePurchases<-NULL
This is a histogram that shows the range of play time hours for every game. The distribution does appear to be normal. It doesn’t skew in either direction, so if I did want to analyze this data further, a t-test would suffice.
hist(data$PlayTimeHours,main="Range of Play Time Hours",xlab="Hours",ylab="Frequency")
I will be creating a scatter plot to check if there’s a correlation between the age and the number of sessions per week. I created a linear regression line and of course there’s no correlation. Age and the number of sessions have no correlation.
library(ggplot2)
ggplot(data,aes(x=Age, y=SessionsPerWeek))+
geom_point(color = "black")+
geom_smooth(method = "lm", se = FALSE, color = "blue")+
labs(title = "Age vs Sessions Per Week",x = "Age",y="Sessions Per Week")
## `geom_smooth()` using formula = 'y ~ x'
## Statistical Calculation
For my statistical calculation, I will create a hypothesis saying that games with a high engagement level will have high play time hours. First I will perform basic statistical calculations such as the average session time and the average play time hours. Then I will perform a t-test
mean(data$SessionsPerWeek)
## [1] 9.471774
mean(data$PlayTimeHours)
## [1] 12.02437
high_engagement<-subset(data, EngagementLevel=="High")
not_high_engagement <-subset(data,EngagementLevel!="High")
t_test <- t.test(high_engagement$PlayTimeHours, not_high_engagement$PlayTimeHours)
t_test
##
## Welch Two Sample t-test
##
## data: high_engagement$PlayTimeHours and not_high_engagement$PlayTimeHours
## t = 0.76604, df = 18022, p-value = 0.4437
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.09428853 0.21526864
## sample estimates:
## mean of x mean of y
## 12.06924 12.00875
With a p-value of 0.4437, it’s safe to say that we do not have enough evidence to support the alternative hypothesis where high engagement level means high play time hours.