library(modeest)
library(readr)
Se cargan los datos con la funcion read.cvs(““)de la libreria readr
#
# datos= read.csv(file = "https://raw.githubusercontent.com/rpizarrog/probabilidad-y-estad-stica/master/2023/datos/exams.csv")
datos = read.csv (file ="/cloud/project/Datos /exams.csv")
head(datos[,c(6,7,8)],10)
## math.score reading.score writing.score
## 1 67 67 63
## 2 40 59 55
## 3 59 60 50
## 4 77 78 68
## 5 78 73 68
## 6 63 77 76
## 7 62 59 63
## 8 93 88 84
## 9 63 56 65
## 10 47 42 45
tail(datos[,c(6,7,8)],10)
## math.score reading.score writing.score
## 991 67 55 53
## 992 87 93 88
## 993 69 63 66
## 994 58 54 58
## 995 86 82 75
## 996 73 70 65
## 997 85 91 92
## 998 32 35 41
## 999 73 74 82
## 1000 65 60 62
media_mat = mean(datos$math.score)
mediana_mat = median(datos$math.score)
moda_mat = mfv(datos$math.score)
paste("media:",media_mat,"mediana:",mediana_mat,"moda:",moda_mat)
## [1] "media: 66.396 mediana: 66.5 moda: 63"