| BasicStatistics {fBasics} | R Documentation |
A collection and description of functions which compute
basic statistical properties. Missing functions in R to
calculate skewness and kurtosis are added, a function
which creates a summary statistics, and functions to
calculate column statistics.
The functions are:
skewness | returns value of skewness, |
kurtosis | returns value of kurtosis, |
basicStats | computes an overview of basic statistical values, |
rowStats | calculates row statistics, |
colStats | calculates column statistics, |
rowAvgs | calculates row means, |
colAvgs | calculates column means, |
rowVars | calculates row variances, |
colVars | calculates column variances, |
rowStdevs | calculates row standard deviations, |
colStdevs | calculates column standard deviations, |
rowSkewness | calculates row skewness, |
colSkewness | calculates column skewness, |
rowKurtosis | calculates row kurtosis, |
colKurtosis | calculates column kurtosis, |
rowCumsums | calculates row cumulated Sums, |
colCumsums | calculates column cumulated Sums. |
skewness(x, ...) ## Default S3 method: skewness(x, na.rm = FALSE, ...) ## S3 method for class 'data.frame': skewness(x, ...) ## S3 method for class 'POSIXct': skewness(x, ...) ## S3 method for class 'POSIXlt': skewness(x, ...) kurtosis(x, ...) ## Default S3 method: kurtosis(x, na.rm = FALSE, ...) ## S3 method for class 'data.frame': kurtosis(x, ...) ## S3 method for class 'POSIXct': kurtosis(x, ...) ## S3 method for class 'POSIXlt': kurtosis(x, ...) basicStats(x, ci = 0.95) rowStats(x, FUN, na.rm = FALSE, ...) rowAvgs(x, na.rm = FALSE, ...) rowVars(x, na.rm = FALSE, ...) rowStdevs(x, na.rm = FALSE, ...) rowSkewness(x, na.rm = FALSE, ...) rowKurtosis(x, na.rm = FALSE, ...) rowCumsums(x, na.rm = FALSE, ...) colStats(x, FUN, na.rm = FALSE, ...) colAvgs(x, na.rm = FALSE, ...) colVars(x, na.rm = FALSE, ...) colStdevs(x, na.rm = FALSE, ...) colSkewness(x, na.rm = FALSE, ...) colKurtosis(x, na.rm = FALSE, ...) colCumsums(x, na.rm = FALSE, ...)
ci |
confidence interval, a numeric value, by default 0.95, i.e. 95 percent. |
FUN |
the statistical function to be applied. |
na.rm |
a logical. Should missing values be removed? |
x |
a numeric vector, or a matrix for column statistics. |
... |
arguments to be passed. |
skewness, kurtosis
returns the value of the statistics, a numeric value.
basicsStats
returns data frame with the following entries and row names:
nobs, NAs, Minimum, Maximum , 1. Quartile, 3. Quartile,
Mean, Median, Sum, SE Mean, LCL Mean, UCL Mean, Variance,
Stdev, Skewness, Kurtosis.
rowStats, rowAvgs, rowVars, rowStdevs,
rowSkewness, rowKurtosis, rowCumsum
computes sample statistics by column. Missing values can be
handled.
colStats, colAvgs, colVars, colStdevs,
colSkewness, colKurtosis, colCumsum
computes sample statistics by column. Missing values can be
handled.
R's-base package contains a function colMeans with an
additional argument dim=1. Therefore, the function used
here to compute column means (averages) is named colAvgs.
Diethelm Wuertz for the Rmetrics R-port.
## basicStats -
xmpBasics("\nStart: Basic Statistics of log-Returns > ")
# Data NYSE Composite Index:
data(nyseres)
basicStats(nyseres)
## moments -
xmpBasics("\nNext: Moments, Skewness and Kurtosis > ")
# Mean, Variance:
mean(nyseres)
var(nyseres)
# Skewness, Kurtosis:
# Note, can handele data.frames:
skewness(nyseres)
kurtosis(nyseres)