# oii.summary: Print summary statistics for a numeric variable In oii: Crosstab and Statistical Tests for OII MSc Stats Course

## Description

This function is designed to be like the built-in `summary` function but include a few additional values. If the input is not numeric, the built-in summary command is executed.

## Usage

 `1` ```oii.summary(x, extended = FALSE, warnings = FALSE) ```

## Arguments

 `x` a numeric vector for which summary statistics should be generated. `extended` a logical value indicating whether additional statistics should be printed (see Value section). Defaults to FALSE stripped before the computation proceeds (defaults to TRUE). `warnings` a logical value indicating whether warnings should be shown (defaults to FALSE, no warnings).

## Value

If `x` is not numeric, the built-in summary command is executed. If `x` is numeric (that is, `is.numeric(x)` returns TRUE), then a list with the following elements is returned:

 `cases` The number of non-missing values in `x` (Valid N) `na` The number of missing values in `x` (Missing N). `mean` The mean value of `x` after missing values are removed. See `mean` `sd` The standard deviation for values in `x`. See `sd` `min` The minimum/smallest value in `x`. See `min` `max` The maximum/largest value in `x`. See `max`

This function also calculates the following statistics, but these are not printed by default unless extended is set to TRUE

 `var` The variance of `x` after missing values are removed. See `var` `median` The median value of `x` after missing values are removed. See `median` `p25` The 25th percentile of `x` after missing values are removed `p75` The 75th percentile of `x` after missing values are removed `skewness` The skewness coefficient for `x` after missing values are removed. See `skewness` `kurtosis` The kurtosis coefficient for `x` after missing values are removed. See `kurtosis`

## See Also

`summary`, `min`, `median`, `mean`, `max`, `sd`, `is.na`, `is.numeric`, `skewness`, `kurtosis`, `var`

## Examples

 ```1 2 3 4 5 6 7 8``` ```#Generate data from a normal distribution with mean 0 and sd 1 #store the result in a variable called tmp tmp<-rnorm(500,mean=0,sd=1) #Print the summary statistics about tmp oii.summary(tmp) #Print even more summary statistics about tmp oii.summary(tmp,extended=TRUE) ```

oii documentation built on May 2, 2019, 6:33 a.m.