Learn R Programming

rgr (version 1.1.15)

gx.summary.groups: Displays Summary Statistics for a Variable Grouped by a Factor

Description

Displays the same concise one-line summary statistics report as gx.summary1 but with the data grouped by the value of a factor variable. The table consists of a heading line and a line of summary statistics for each ‘group’, value of the factor variable. Optionally the data may be logarithmically (base 10) transformed.

Usage

gx.summary.groups(group, x, xname = deparse(substitute(x)), 
	log = FALSE)

Arguments

group

the name of the factor variable the data are to be grouped by.

x

name of the variable to be processed.

xname

by default the character string for x is used for the title. An alternate title can be displayed with xname = "text string", see Examples.

log

if the summary statistics are required following a log10 transformation, set log = TRUE.

Details

Setting log = TRUE results in a log transformation for the parametric statistical estimates. The maximum, minimum, quartiles and robust estimates of spread are estimated and reported in natural measurement units. Of the parametric statistics, the mean (the geometric mean) and 95%confidence are reported backtransformed into natural measurement units.

See Also

gx.summary1, gx.summary, gx.stats, ltdl.fix.df, remove.na, gx.summary2

Examples

Run this code
# NOT RUN {
data(kola.c)
attach(kola.c)

## Generates an initial display
gx.summary.groups(COUNTRY, Cu)

## Provide a more informative display
gx.summary.groups(COUNTRY, Cu, xname = "Cu (mg/kg) in <2 mm O-horizon soil")

## As above but with a log10 transformation to display
## the geometric mean, etc.
gx.summary.groups(COUNTRY, Cu, xname = "Cu (mg/kg) in <2 mm O-horizon soil",
	log = TRUE)

## Detach test data
detach(kola.c)
# }

Run the code above in your browser using DataLab