library(readxl)
Sleep <- read_excel("C:/Users/Maple/Desktop/HU/Second sem/Data Visualization/Sleep_stats.xlsx")
## readxl works best with a newer version of the tibble package.
## You currently have tibble v1.4.2.
## Falling back to column name repair from tibble <= v1.4.2.
## Message displays once per session.
View(Sleep)
mean(Sleep$Sleep_Quality)
## [1] 78.3125
2.What is the standard deviation of my sleep score
sd(Sleep$Sleep_Quality)
## [1] 8.332417
barplot(Sleep$Sleep_Quality, main = "Sleep Score", col = "blue")
boxplot(Sleep$Sleep_Quality, main = "Sleep Score", col = "yellow")
library(readxl)
Sleep <- read_excel("C:/Users/Maple/Desktop/HU/Second sem/Data Visualization/Sleep_stats.xlsx")
Cor <- cor(Sleep,use="pairwise", method="pearson")
library(corrplot)
## corrplot 0.84 loaded
corrplot(Cor)
library(readxl)
Sleep <- read_excel("C:/Users/Maple/Desktop/HU/Second sem/Data Visualization/Sleep_stats.xlsx")
lm(formula=Sleep_Quality ~ In_bed_time+Time_in_Bed+Deep_Sleep+Awake_Time,data = Sleep)
##
## Call:
## lm(formula = Sleep_Quality ~ In_bed_time + Time_in_Bed + Deep_Sleep +
## Awake_Time, data = Sleep)
##
## Coefficients:
## (Intercept) In_bed_time Time_in_Bed Deep_Sleep Awake_Time
## 56.452 -2.794 4.802 -1.168 -4.787
plot(lm(formula=Sleep_Quality ~ In_bed_time+Time_in_Bed+Deep_Sleep+Awake_Time,data = Sleep))