Skip to contents

Summary statistics for numeric variables.

Usage

summary_num(
  x,
  type = FALSE,
  other_means = FALSE,
  skewness = FALSE,
  kurtosis = FALSE
)

Arguments

x

A numeric vector

type

A boolean value, if TRUE the function will add metrics related to the variables type (default = TRUE)

other_means

A boolean value, if TRUE the function will add the harmonic and geometric means (default = FALSE)

skewness

A boolean value, if TRUE the function will add the skewness coefficients (default = FALSE)

kurtosis

A boolean value, if TRUE the function will add the kurtosis coefficients (default = FALSE)

Value

A tibble with the summary metrics.

Details

By default the summary statistics are:
- min: the minimum;
- p25: the first quartile;
- p50: the second quartile (median);
- p75: the third quartile;
- max: the maximum;
- mode: the peak density value;
- mean: the mean;
- cv: the coefficient of variation.

If `type` = TRUE, the following metrics will be added:
- n: the number of observations;
- na: the number of missing values;
- negative: the number of negative values;
- equal_zero: the number of values equal to zero;
- positive: the number of positive values.

If `other_means` = TRUE, the following metrics will be added:
- geometric_mean: the geometric mean;
- harmonic_mean: the harmonic mean.

If `skewness` = TRUE, the following metrics will be added:
- Bowley
- Fisher-Pearson
- Kelly
- Rao
- Pearson median

If `kurtosis` = TRUE, the following metrics will be added:
- Bowley
- Fisher-Pearson
- Kelly
- Rao
- Pearson median

Examples


x <- c(rnorm(10),NA,10)

x
#>  [1] -0.1803943 -1.5676751 -0.2607259  0.9618104  0.8538955  0.4187967
#>  [7]  0.3399565  0.5964251  1.8714180  0.6028704         NA 10.0000000

summary_num(x)
#> # A tibble: 1 × 8
#>     min    p25   p50   p75   max  mode  mean    cv
#>   <dbl>  <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 -1.57 0.0798 0.596 0.908    10 0.574  1.24  2.44