Displays Summary Statistics for a Variable Grouped by a Factor
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.
gx.summary.groups(group, x, xname = deparse(substitute(x)), log = FALSE)
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 |
log |
if the summary statistics are required following a log10 transformation, set |
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.
Any less than detection limit values represented by negative values, or zeros or other numeric codes representing blanks in the data, must be removed prior to executing this function, see ltdl.fix.df
.
Any NA
s in the data vector will be removed prior to computation in function gx.stats
. Display of the number of NAs
found by function remove.na
is suppressed in remove.na
as the information is included in the display from this function.
Alternately, function framework.summary
generates grouped summary statistics that are exported in a file format that can be directly imported into a spreadsheet, e.g., MS Excel, for inspection, or into other software, e.g., a Geographical Information System (GIS) where the spatial information concerning the ‘framework’ units is available, e.g., ecoclassification units.
For more extensive summary statistics displaying one variable at a time, see gx.summary2
using a construct like gx.summary2(var[factor == "value"])
or use function inset
with a similar construct.
Robert G. Garrett
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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.