y
from Exercise4_data.RData
.y
and report on the shape of the datahist(y)
Hard to say, the data seems to be bi-modal. Somewhere around 6? as there seems to be more mass around 10 than around 1.
mean(y)
## [1] 5.777224
median(y)
## [1] 6.12544
round()
).round(y) %>% table
## .
## -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
## 3 3 3 3 8 8 8 5 5 7 5 5 12 13 5 4 1 2
The mode seems to be around 10
The mean, median and mode are all different. This means data de data are non-normal. The histogram clearly shows this. If we plot the density, this becomes even more apparent:
y %>% density %>% plot
lsfun <- function(meanestimate) apply(outer(y, meanestimate, "-")^2, 2, sum)
curve(lsfun, from = 2, to = 10)
curve(lsfun, from = 5.5, to = 6)
meanestimate
that would minimize the least squares functionNaturally, this is the mean of y
, which equals 5.777224
End of practical.