Function to Display Membership Probabilities and Other Relevant Data
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.
gx.md.display(xx, pcut = 0.1, ifprint = TRUE, file = NULL)
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, |
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, |
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.
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 |
This function is similar in purpose to gx.mvalloc.print
for displaying multivariate outliers, however, it operates on a single population.
Robert G. Garrett
## 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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.