Learn R Programming

rgr (version 1.1.0)

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.

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
an informative display title, e.g., xlab = "Cu (mg/kg) in <2 mm="" o-horizon="" soil"<="" code=""> rather than the default variable name of deparse(substitute(xx)).
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
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, "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, "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