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

View source: R/sd.R

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 standard deviation based on a known formula. sd.fdt.multiple calls sd.fdt for each variable, that is, each column of the data.frame.

Value

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

Author(s)

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

See Also

var.fdt, mean.fdt.

Examples

library(fdth)

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

head(mdf)

# From a data.frame
apply(mdf,
      2,
      sd)

# From a fdt object
sd(fdt(mdf))

unlist(sd(fdt(mdf)))

fdth documentation built on May 12, 2026, 1:08 a.m.