gx.md.display: Function to Display Membership Probabilities and Other...

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

Function to display the Mahalanobis distances (MDs) and predicted probabilities of membership (ppm or p_gm), together with other relevant data, following computations by functions gx.md.gait, gx.md.gait.closed, gx.mva, gx.mva.closed, gx.robmva or gx.robmva.closed. The user may select the predicted probability of membership below which the results are displayed. A simpler presentation is available with gx.md.print. Optionally the entire generated table may be saved as a ‘.csv’ file for future use.

Usage

1
gx.md.display(xx, pcut = 0.1, ifprint = TRUE, file = NULL)

Arguments

xx

the data matrix to be displayed, see Details below.

pcut

the probabilitity of group membership below which records will be displayed on the current device in ascending order of membership probability, i.e. the most outlying individuals first.

ifprint

by default, ifprint = TRUE, the most outlying individuals are displayed displayed on the current device, see pcut above. To suppress the display set pcut = FALSE.

file

the name of the folder where the file is to be saved, a ‘/’ is appended before the synthesized file name, details of which are displayed on the current device. If no folder is specified, the files are saved to the Working Directory, see Details below. The default, file = NULL, results in no file being saved.

Details

The data frame from which the matrices were derived from for use by the above listed functions must be attached if such items as (numeric) sample IDs, coordinates and data values are to be displayed. Those numeric variables to be displayed must be appended in a cbind construct following the ‘MDs’ and ‘ppms’ extracted from the saved objects from the above listed functions. For example, xx <- cbind(save.sind$md, save.sind$ppm, E, N, Zn, Cu). If row names were present in the original data frame they will have been carried forward in any saved object from an ‘rgr’ function and will be displayed in the first column of the table.

The table generated by the function may be saved as a ‘.csv’ file in a folder of the user's choice or in the working directory, with the ‘.csv’ being appended in the function, see Example below. If file = "" or file = " " the file is saved to the Working Directory. The file name is synthesized as ‘\MD_display.csv’ and appended to the folder name.

Value

table.rows

The displayed table is returned and may be saved as an object if required. It will contain the information passed to the function as xx sorted by MD and with appropriate column headings.

Note

This function is similar in purpose to gx.mvalloc.print for displaying multivariate outliers, however, it operates on a single population.

Author(s)

Robert G. Garrett

See Also

gx.md.gait, gx.md.gait.closed, gx.mva, gx.mva.closed, gx.robmva, gx.robmva.closed, gx.mvalloc, gx.mvalloc.print, gx.md.print.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Make test data available
data(sind.mat2open)
data(sind)
attach(sind)
## data frame sind attached to provide access to row IDs

## Estimate and default display robust Mahalanobis distances
sind.save <- gx.robmva.closed(sind.mat2open)
xx <- cbind(sind.save$md, sind.save$ppm, E, N, Cu, Zn)
gx.md.display(xx)

## Save display for future use in the Working Directory
gx.md.display(xx, file = " ")

## Clean-up
rm(sind.save)
rm(xx)
detach(sind)

rgr documentation built on May 2, 2019, 6:09 a.m.

Related to gx.md.display in rgr...