Functions for computing summary statistics for use in cb_summarize_numeric().
skew()andkurtosis()return adjusted skewness and kurtosis. (Unadjusted estimates can be obtained by settingadjusted = FALSE.)spread()returns the difference between a vector's minimum and maximum values.min_if_any()andmax_if_any()return minima and maxima with alternate behavior if all values are missing. (Re-exported from the lighthouse package. Seelighthouse::min_if_anyfor more details.)se_mean()returns the standard error of the mean. (Re-exported from the lighthouse package. Seelighthouse::se_meanfor more details.)
Usage
skew(x, adjusted = TRUE, na.rm = FALSE)
kurtosis(x, adjusted = TRUE, excess = TRUE, na.rm = FALSE)
spread(x, na.rm = FALSE)
min_if_any(..., na.rm = TRUE)
max_if_any(..., na.rm = TRUE)
se_mean(x, na.rm = FALSE)Arguments
- x
A numeric vector.
- adjusted
If
TRUE, returns adjusted skewness (G1) or kurtosis (G2) by applying a small-sample correction. IfFALSE, returns the unadjusted skewness (g1) or kurtosis (g2). (Note thatTRUEcorresponds to behavior of software such as SPSS, SAS, and Excel.)- na.rm
Should missing values be removed? (Note that
cb_summarize_numeric()automatically sets na.rm toTRUEfor all functions).- excess
If
TRUE, returns excess kurtosis by (total kurtosis - 3).- ...
A numeric vector or vectors.