This function calculates the min, max, median, mean, standard deviation, skew
and kurtosis
for the specified object and displays the results in a semi-tabular form. An option is provided to set the number of digits displayed for the returned values.
Note: see the help pages in this package for theskew
and thekurt
for information on those implementations.
mystat(x, numdig = 3, na.rm = TRUE, printit = TRUE)
A data frame with scalar elements matching their names:
minimum
maximum
mean value
median
standard deviation
skew
kurtosis
A vector or vectorizable object.
How many digits to the right of the decimal point to display (when printit
is TRUE.
Does the user desire NA values to be removed. Rare is the need to set this to FALSE.
Set to TRUE to see the results, nicely formatted, in the console.
Carl Witthoft, carl@witthoft.com
theskew
, thekurt
x <- runif(100)
mystat(x)
mystat(x,numdig=6)
Run the code above in your browser using DataLab