library(tidyverse)
library("readxl")
library(plotly)
gc <- read_excel("/Users/nikolajdolgih/Desktop/Метрика.xlsx")
g <- ggplot(data = gc) + 
geom_bar(aes(x=end))+
xlab("оценки") + 
ylab("количество")+
theme_minimal()+
xlim(1,10)
fig <- ggplotly(g)
fig
gc$end = as.numeric(gc$end)
shapiro.test(x = gc$end)
## 
##  Shapiro-Wilk normality test
## 
## data:  gc$end
## W = 0.9378, p-value = 1.482e-07
mean(gc$end)
## [1] 4.935
sqrt(var(gc$end))
## [1] 1.24035
gc1 = gc %>% group_by(end) %>% summarise(number = n())
gc1 = gc1 %>% mutate(prob = number/sum(number))
gc1 = gc1 %>% select(-number)
g <- ggplot(data = gc1) + 
geom_col(aes(x=end, y = prob))+
stat_function(fun = dnorm, args = list(mean = mean(gc$end), sd = sqrt(var(gc$end))), color = "#FF0000")+
xlab("оценки") + 
ylab("количество")+
xlim(1,10)+
theme_minimal()
g