mystat {cgwtools}R Documentation

Calculate and display basic statistics for an object.

Description

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.

Usage

mystat(x, numdig = 3, na.rm = TRUE, printit = TRUE)

Arguments

x

A vector or vectorizable object.

numdig

How many digits to the right of the decimal point to display (when printit is TRUE.

na.rm

Does the user desire NA values to be removed. Rare is the need to set this to FALSE.

printit

Set to TRUE to see the results, nicely formatted, in the console.

Value

A data frame with scalar elements matching their names:

min

minimum

max

maximum

mean

mean value

median

median

sdev

standard deviation

skew

skew

kurtosis

kurtosis

Author(s)

Carl Witthoft, carl@witthoft.com

See Also

theskew , thekurt

Examples

x <- runif(100)
mystat(x)
mystat(x,numdig=6)

[Package cgwtools version 4.1 Index]