sd: Standard deviation of frequency distribution table (numerical...

sdR Documentation

Standard deviation of frequency distribution table (numerical variable)

Description

S3 methods for the standard deviation of a fdt.
Useful to estimate the standard deviation (when the real data vector is not known) from a previous fdt.

Usage

## S3 generic
sd(x, ...)

## S3 methods: numerical
## Default S3 method:
sd(x, ...)

## S3 method for class 'fdt'
sd(x, ...)

## S3 method for class 'fdt.multiple'
sd(x, ...)

Arguments

x

a fdt (simple or multiple) object.

...

required to be generic.

Details

sd.fdt calculates the value of the variance based on a known formula. sd.fdt.multiple calls sd.fdtfor each variable, that is, each column of the data.frame.

Value

sd.fdt returns a numeric vector containing the value of the median of the fdt. median.fdt.multiple returns a list, where each element is a numeric vector containing the value of the variance of the fdt for each variable.

Author(s)

Faria, J. C.
Allaman, I. B
Jelihovschi, E. G.

See Also

var.fdt, mean.fdt.

Examples

mdf <- data.frame(x=rnorm(1e3, 
                          20, 
                          2),
                  y=rnorm(1e3, 
                          30,
                          3),
                  z=rnorm(1e3,
                          40,
                          4))

head(mdf)

apply(mdf,
      2,
      sd)

sd(fdt(mdf))      

fdth documentation built on Nov. 18, 2023, 1:08 a.m.