stat.desc: Descriptive statistics on a data frame or time series

Description Usage Arguments Value Note Author(s) See Also Examples

Description

Compute a table giving various descriptive statistics about the series in a data frame or in a single/multiple time series

Usage

1
stat.desc(x, basic=TRUE, desc=TRUE, norm=FALSE, p=0.95)

Arguments

x

a data frame or a time series

basic

do we have to return basic statistics (by default, it is TRUE)? These are: the number of values (nbr.val), the number of null values (nbr.null), the number of missing values (nbr.na), the minimal value (min), the maximal value (max), the range (range, that is, max-min) and the sum of all non-missing values (sum)

desc

do we have to return various descriptive statistics (by default, it is TRUE)? These are: the median (median), the mean (mean), the standard error on the mean (SE.mean), the confidence interval of the mean (CI.mean) at the p level, the variance (var), the standard deviation (std.dev) and the variation coefficient (coef.var) defined as the standard deviation divided by the mean

norm

do we have to return normal distribution statistics (by default, it is FALSE)? the skewness coefficient g1 (skewness), its significant criterium (skew.2SE, that is, g1/2.SEg1; if skew.2SE > 1, then skewness is significantly different than zero), kurtosis coefficient g2 (kurtosis), its significant criterium (kurt.2SE, same remark than for skew.2SE), the statistic of a Shapiro-Wilk test of normality (normtest.W) and its associated probability (normtest.p)

p

the probability level to use to calculate the confidence interval on the mean (CI.mean). By default, p=0.95

Value

a data frame with the various statistics in rows and with each column correponding to a variable in the data frame, or to a separate time series

Note

The Shapiro-Wilk test of normality is not available yet in Splus and it returns 'NA' in this environment. If you prefer to get separate statistics for various time intervals in your time series, use stat.slide(). If your data are fish or plankton sampled with a net, consider using the Pennington statistics (see stat.pen())

Author(s)

Frédéric Ibanez (ibanez@obs-vlfr.fr), Philippe Grosjean (phgrosjean@sciviews.org)

See Also

stat.slide, stat.pen

Examples

1
2
data(marbio)
stat.desc(marbio[,13:16], basic=TRUE, desc=TRUE, norm=TRUE, p=0.95)

Example output

Loading required package: boot
                  Nauplii      Oithona  Acanthaires  Cladocerans
nbr.val      6.800000e+01 6.800000e+01 6.800000e+01 6.800000e+01
nbr.null     0.000000e+00 0.000000e+00 8.000000e+00 4.500000e+01
nbr.na       0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
min          3.000000e+00 3.900000e+01 0.000000e+00 0.000000e+00
max          6.360000e+02 7.792000e+03 5.200000e+01 2.000000e+02
range        6.330000e+02 7.753000e+03 5.200000e+01 2.000000e+02
sum          9.018000e+03 1.051590e+05 9.870000e+02 3.940000e+02
median       1.040000e+02 1.228000e+03 1.200000e+01 0.000000e+00
mean         1.326176e+02 1.546456e+03 1.451471e+01 5.794118e+00
SE.mean      1.254198e+01 1.554392e+02 1.458903e+00 3.035968e+00
CI.mean.0.95 2.503389e+01 3.102580e+02 2.911983e+00 6.059818e+00
var          1.069648e+04 1.642972e+06 1.447311e+02 6.267629e+02
std.dev      1.034238e+02 1.281785e+03 1.203042e+01 2.503523e+01
coef.var     7.798644e-01 8.288530e-01 8.288439e-01 4.320802e+00
skewness     2.037948e+00 2.579061e+00 9.098177e-01 6.945251e+00
skew.2SE     3.504462e+00 4.434961e+00 1.564525e+00 1.194307e+01
kurtosis     6.433595e+00 8.866041e+00 5.389480e-01 5.039083e+01
kurt.2SE     5.604129e+00 7.722966e+00 4.694629e-01 4.389407e+01
normtest.W   8.239310e-01 7.538448e-01 9.182658e-01 2.253478e-01
normtest.p   1.507164e-07 2.457408e-09 2.736262e-04 3.745683e-17

pastecs documentation built on May 2, 2019, 3:36 p.m.

Related to stat.desc in pastecs...