sdCalc {NCStats}R Documentation

Shows the steps in the manual calculation of the standard deviation.

Description

Shows the steps in the manual calculation of the standard deviation.

Usage

  sdCalc(x, digits = getOption("digits"))

  ## S3 method for class 'sdCalc'
 print(x, ...)

Arguments

x

A numeric vector.

digits

A numeric indicating the number of decimals to round the numeric summaries to. If left at NULL (default) then the number of digits will be obtained from getOption('digits').

...

Other arguments to the generic print functions. Not currently used.

Value

A list containing the sample size (n), sample mean (mean), data.frame of intermediate calculations (tbl), and number of digits to print (digits)).

Note

This function shows a table of intermediate output in the calculation of the standard deviation. Used purely to demonstrate the hand-calculation of the standard deviation. Use sd() to actually computer the standard deviation.

See Also

sd.

Examples

## Numeric vector
y <- runif(8)
# typical computation
sd(y)
# this function
sdCalc(y)
# this function, controlling the number of digits
sdCalc(y,digits=4)

[Package NCStats version 0.3.4 Index]