Learn R Programming

rgr (version 1.1.15)

framework.stats: Compile Framework/Subset Summary Statistics

Description

Function to compile summary statistics for use with function framework.summary from the ‘output’ of function gx.stats.

Usage

framework.stats(xx)

Arguments

xx

name of the variable to be processed.

Value

table

a 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 compiles 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

gx.stats, ltdl.fix.df, remove.na

Examples

Run this code
# NOT RUN {
## 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

## Clean-up and detach test data
rm(fs)
detach(kola.c)
# }

Run the code above in your browser using DataLab