epi.descriptives {epiR}R Documentation

Descriptive statistics

Description

Computes descriptive statistics from a vector.

Usage

epi.descriptives(dat, conf.level = 0.95)

Arguments

dat

vector for which descriptive statistics will be calculated.

conf.level

magnitude of the returned confidence intervals. Must be a single number between 0 and 1.

Value

A list containing the following:

arithmetic

n number of observations, mean arithmetic mean, sd arithmetic standard deviation, q25 25th quantile, q50 50th quantile, q75 75th quantile, lower lower bound of the confidence interval, upper upper bound of the confidence interval, min minimum value, max maximum value, and na number of missing values.

geometric

n number of observations, mean geometric mean, sd geometric standard deviation, q25 25th quantile, q50 50th quantile, q75 75th quantile, lower lower bound of the confidence interval, upper upper bound of the confidence interval, min minimum value, max maximum value, and na number of missing values.

symmetry

skewness and kurtosis.

Examples

## EXAMPLE 1:
## Generate some data:
id <- 1:100
n <- rnorm(100, mean = 0, sd = 1)
dat.df01 <- data.frame(id, n)

# Add missing values:
missing <- dat.df01$id %in% sample(dat.df01$id, size = 20)
dat.df01$n[missing] <- NA

epi.descriptives(dat.df01$n, conf.level = 0.95)

[Package epiR version 2.0.31 Index]