rgr (version 1.1.15)

gx.md.print: Function to Display Membership Probabilities

Description

Function to display the Mahalanobis distances (MDs) and predicted probabilities of membership (ppm) 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. Alternately the Mahalanobis distances and group membership probabilities may be saved as a ‘.csv’ file for future use.

Usage

gx.md.print(save, pcut = 0.1, ifprint = TRUE, file = NULL)

Arguments

save

a saved object from any of functions gx.md.gait, gx.md.gait.closed, gx.mva, gx.mva.closed, gx.robmva, or gx.robmva.closed.

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.

Value

table.rows

The last table processed is returned and may be saved as an object if required.

Details

The Mahanalobis distances, the membership probabilities and input matrix row numbers or IDs are extracted from the saved object and sorted in increasing order of probabilities of group membership for display on the current device. The full table of Mahalanobis distances and group membership probabilities may be saved as a ‘.csv’ file. If a folder name has been provided in file, a ‘\’ is appended prior to a file name synthesized from the name of the saved object concatenated with ‘_MDs.csv’. If file = "" or file = " " the file will be saved to the Working Directory. Details of the file name are displayed on the current device, see Example below. For an alternative display see gx.md.display.

See Also

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

Examples

Run this code
# NOT RUN {
## Make test data available
data(sind.mat2open)

## Estimate and display robust Mahalanobis distances
sind.save <- gx.robmva.closed(sind.mat2open)
gx.md.print(sind.save, pcut = 0.3)

## Save display for future use, not executed
## gx.md.print(sind.save, ifprint = FALSE, file = "D://R_work//Project3")

## Clean-up
rm(sind.save)
# }

Run the code above in your browser using DataCamp Workspace