x <- c(1.2, 3.0, -4, 5, 6, -2, 4, 6, 6, 2.3, 5, 6, 4, 3)
xm = mean(x)
Data_Mean = x-xm
Square_Data = Data_Mean^2
Sum_Square = sum(Square_Data)
Population_N <- c(length(x))
Standard_Deviation = sqrt(Sum_Square/(Population_N-1))
Standard_Deviation
## [1] 3.074148
z = sd(x)
if (Standard_Deviation == z) {
print("Standard_Deviation is equal to sd(x)")
}
## [1] "Standard_Deviation is equal to sd(x)"
The standard deviation calculated is 3.074148. The value calculated using the sd function was 3.074148. Both methods produced the same result.
The breaks argument controls the number of bins, cells, or bars in a
histogram. It sorts the data based accordingly.
When the break is 3, the frequency of each bar increases, as more x values are included. A wide range of x values are included on the axis.
When the break is 10, the frequency of each bar decreases, as more x values are individually separated.