Learn R Programming

rgr (version 1.1.7)

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, file = NULL)

Arguments

save
a saved object from any of functions gx.md.gait, gx.md.gait.closed, gx.mva, 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. most outlying individuals first.
file
the file name for saving the function output in the R working directory, see Details below.

Value

  • The last displayed table, table.rows, is returned and may be saved as an object if required.

Details

The Mahanalobis distances, the membership probabilities and input matrix row numbers 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 in the working directory, with the .csv being appended in the function. See example below. If file = "" or file = "" a default file name is generated from the input file name from the function that generated the Mahalanobis distances and _MDs.csv.

See Also

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

Examples

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

## Estimate and display robust Mahalanobis distances
sind.save <- gx.md.gait.closed(sind.mat2open, mcdstart = TRUE, ifadd = NULL)
gx.md.print(sind.save, pcut = 0.3)

## Save display for future use
gx.md.print(sind.save, file = "sind.save.ilr.mcd.mds")

## Clean-up
rm(sind.save)

Run the code above in your browser using DataLab