Learn R Programming

rgr (version 1.0.4)

framework.stats: Compute Framework/Subset Summary Statistics

Description

Function to compute summary statistics for use with function framework.summary.

Usage

framework.stats(xx)

Arguments

xx
name of the variable to be processed.

Value

  • tablea 20-element table is returned, see below.
  • [1]the data/subset (sample) size, N.
  • [2]number of NAs encountered in the input vector, NNA.
  • [3:13]the data minimum, 2nd, 5th, 10th, 25th (Q1), 50th (median), 75th (Q3), 90th, 95th and 98th percentiles and the maximum.
  • [14:15]the lower and upper 95% confidence bounds for the median.
  • [16]the Median Absolute Deviation (MAD).
  • [17]the Inter-Quartile Standard Deviation (IQSD).
  • [18]the data (sample) Mean.
  • [19]the data (sample) Standard Deviation (SD).
  • [20]the Coefficient of Variation as a percentage (CV%).

Details

The function computes summary statistics consisting of the count of valid data, the number of NAs, the minimum, 2nd, 5th, 10th, 25th (Q1), 50th (median), 75th (Q3), 90th, 95th and 98th percentiles and the maximum. The 95% confidence interval for the median is computed via the binomial theorem. In addition the Median Absolute Deviation (MAD) and Inter-Quartile Standard Deviation (IQSD) are computed as robust estimates of the standard deviation. Finally, the mean, standard deviation and coefficient of variation as a percentage are computed.

See Also

ltdl.fix.df, remove.na

Examples

Run this code
## Make test data available
data(kola.c)
attach(kola.c)

## Computes summary statistics for the Cu data
fs <- framework.stats(Cu)
fs

## Computes summary statistics for Finnish subset of the Cu data
fs <- framework.stats(Cu[COUNTRY == "FIN"])
fs

## Detach test data
detach(kola.c)

Run the code above in your browser using DataLab