Displays Summary Statistics for a Matrix or Data Frame

Share:

Description

Displays the same concise one-line summary statistics report as gx.summary1 for two or more columns of a matrix or data frame. The table consists of a heading line and a line of summary statistics for each ‘variable’, column of the matrix or data frame. Optionally the data may be logarithmically (base 10) transformed.

Usage

1
2
gx.summary.mat(xmat, vars, banner = deparse(substitute(xmat)),
	log = FALSE)

Arguments

xmat

name of the matrix or data frame.

vars

the indices, or names (see Example), of the columns of the matrix or data frame for the variables whose summary statistics are to be displayed.

banner

by default the character string for xmat, the input matrix, is used for the title. An alternate title can be displayed with banner = "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.

Note

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 NAs 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.

For a more extensive summary statistics display a variable at a time, see gx.summary2, and for a summary with graphical displays see inset.

For summary graphical presentations see functions bwplots.by.var or tbplots.by.var.

Author(s)

Robert G. Garrett

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Make test data available
data(kola.o)
attach(kola.o)

## Generates an initial display for As [6], Co [13], Cu [15],
## Ni [24] and Zn [38] 
gx.summary.mat(kola.o, c(6, 13, 15, 24, 38))

## Alternately
gx.summary.mat(kola.o, c("As", "Co", "Cu", "Ni", "Zn"))

## Provide a more informative display for Be [9], La [19], P [25],
## Th [33], U [35] and Y[37]
gx.summary.mat(kola.o, c(9, 19, 25, 33, 35, 37), 
	banner = "Kola Project, <2 mm O-horizon soils")

## As above but with a log10 transformation to display
## the geometric mean, etc.
gx.summary.mat(kola.o, c("Be", "La", "P", "Th", "U", "Y"), 
	log = TRUE, banner = "Kola Project, <2 mm O-horizon soils")

## Detach test data
detach(kola.o)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.