loading...

Compute a table giving various descriptive statistics, including Pennington's estimators of the mean, the variance and the variance of the mean, about the series in a data frame or in a single/multiple time series

stat.pen(x, basic=FALSE, desc=FALSE)

Arguments

x

a data frame or a time series

basic

do we have to return also basic statistics (by default, it is FALSE)? 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 also various descriptive statistics (by default, it is FALSE)? 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

Value

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

References

Aitchison, J., 1955. On the distribution of a positive random variable having a discrete probability mass at the origin. J. Amer. Stat. Ass., 50:901-908.

Pennington, M., 1983. Efficient estimations of abundance for fish and plankton surveys. Biometrics, 39:281-286.

Author

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

Note

If you prefer to get separate statistics for various time intervals in your time series, use stat.slide(). Various other descriptive statistics, including test of the normal distribution are also available in stat.desc()

See also

Examples

data(marbio)
stat.pen(marbio[,c(4, 14:16)], basic=TRUE, desc=TRUE)
#>              Copepodits2     Oithona Acanthaires Cladocerans
#> nbr.val        68.000000      68.000   68.000000   68.000000
#> nbr.null        5.000000       0.000    8.000000   45.000000
#> percnull        7.352941       0.000   11.764706   66.176471
#> nbr.na          0.000000       0.000    0.000000    0.000000
#> median         24.500000    1228.000   12.000000    0.000000
#> mean           39.632353    1546.456   14.514706    5.794118
#> var          1619.877744 1642971.655  144.731124  626.762950
#> std.dev        40.247705    1281.785   12.030425   25.035234
#> pos.median     28.000000    1228.000   13.000000    4.000000
#> pos.mean       42.777778    1546.456   16.450000   17.130435
#> pos.var      1613.788530 1642971.655  131.980508 1705.754941
#> pos.std.dev    40.171987    1281.785   11.488277   41.300786
#> geo.mean       31.504949    1161.198   12.030807    6.482851
#> pen.mean       38.604561    1624.345   16.011929    4.183929
#> pen.var      1302.882154 2463485.626  389.856084  144.116540
#> pen.std.dev    36.095459    1569.549   19.744774   12.004855
#> pen.mean.var   18.476177   34230.002    5.325181    1.900941