#' Calculate Standard Deviation
#'
#' Calculate Standard Deviation
#' sqrt(sum((values-mean(values))^2)/(length(values)-1))
#' @param values The values for calculating the Standard Deviation
#' @keywords deviation
#' @export
#' @examples
#' calculateStandardDeviation(c(5,6,7))
calculateStandardDeviation <- function(values) {
return(sd(values))
}
#' Calculate Empirical Rule
#'
#' Calculate Empirical Rule
#' dnorm(values,mean = mean(values),sd=sqrt(sum((values-mean(values))^2)/(length(values)-1)),log = FALSE)
#' @param values The values for calculating the Empirical Rule
#' @keywords deviation
#' @export
#' @examples
#' calculateEmpiricalRule(c(5,6,7))
calculateEmpiricalRule <- function(values){
return(dnorm(values,mean = mean(values),sd=sqrt(sum((values-mean(values))^2)/(length(values)-1)),log = FALSE))
}
#' Calculate Coefficient of Variation
#'
#' Calculate Coefficient of Variation
#' sd(values)/mean(values)*100
#' @param values The values for calculating the Coefficient of Variation
#' @keywords deviation
#' @export
#' @examples
#' calculateCoefficientOfVariation(c(5,6,7))
calculateCoefficientOfVariation <- function(values){
return(sd(values)/mean(values)*100)
}
#' Calculate Skewness
#'
#' Calculate Skewness
#' sd(values)/mean(values)*100
#' @param values The values for calculating the Calculate Skewness
#' @keywords deviation
#' @export
#' @examples
#' calculateSkewness(c(5,6,7))
calculateSkewness <- function(values){
lenght = length(values)
values.z = (values-mean(values))/sd(values)
skewness = lenght/((lenght-1)*(lenght-2))*sum(values.z^3)
return(skewness)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.