Saves a NGR Report Summary Statistics Table to a .csv File

Description

Prepares a .csv file with the standard set of NGR Report summary statistics for further processing with a spread sheet program. The table includes: N (data set size), number of NAs, mean, SD, skew, CV%, geometric mean, median, MAD, robust CV%, and the miniumum and maximum values and 17 intermediate percentiles.

Usage

1
2
gx.ngr.summary(xmat, vars, banner = deparse(substitute(xmat)),
	file = NULL)

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 in the file name. An alternate title can be displayed with banner = "text string", see Details below.

file

the name of the folder where the files are to be saved, a ‘/’ is appended before the synthesized file name, details of which are displayed on the current device. If no file is specified, the files are saved to the Working Directory.

Details

The file name is synthesized by concatenating the input matrix name and ‘_NGR_Summary.csv’, and prefixed by sQuote/. If a data frame is the data source, the synthesize file name will be ‘/dataframe_NGR_Summary.csv’, as it is not possible to obtain the text string for the data frame name from xmat. In such cases the user should rename the .csv file mpre appropriately after it has been saved. If a folder name has been provided in file, for example, file = "D://R_work//Project3", a ‘/’ is appended prior to the synthesized file name.

The file name for the .csv file is displayed on the current device, and all other output is suppressed. The output file can be inspected with spread sheet software or a viewer of the user's choice.

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 that is prepared by gx.ngr.stats.

For a more extensive summary statistics display a variable at a time, see gx.summary2.

Author(s)

Robert G. Garrett

See Also

gx.ngr.stats, gx.stats, gx.ngr.skew, ltdl.fix.df, remove.na, gx.summary1, gx.summary2

Examples

1
2
3
4
5
## Make test data available
data(sind.mat2open)

## Prepare and export a .csv file 
gx.ngr.summary(sind.mat2open)

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