| Title: | Unifying Multiple Biplot Visualisations into a Single Display |
|---|---|
| Description: | Aligning multiple visualisations by utilising generalised orthogonal Procrustes analysis (GPA) before combining coordinates into a single biplot display as described in Nienkemper-Swanepoel, le Roux and Lubbe (2023)<doi:10.1080/03610918.2021.1914089>. This is mainly suitable to combine visualisations constructed from multiple imputations, however, it can be generalised to combine variations of visualisations from the same datasets (i.e. resamples). |
| Authors: | Johané Nienkemper-Swanepoel [aut, cre, cph] (ORCID: <https://orcid.org/0000-0001-6086-8272>) |
| Maintainer: | Johané Nienkemper-Swanepoel <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.1.1 |
| Built: | 2026-05-12 14:09:56 UTC |
| Source: | https://github.com/jnienk/gpabin |
Creates a multiple correspondence analysis (MCA) biplot
biplFig( missbp, Z.col = "#61223b", CLP.col = "#b79962", Z.pch = 19, CLP.pch = 15, Z.cex = 1.5, CLP.cex = 1.7, title = "" )biplFig( missbp, Z.col = "#61223b", CLP.col = "#b79962", Z.pch = 19, CLP.pch = 15, Z.cex = 1.5, CLP.cex = 1.7, title = "" )
missbp |
An object of class |
Z.col |
Colour of sample coordinates |
CLP.col |
Colour of category level point coordinates |
Z.pch |
Plotting character of sample coordinates |
CLP.pch |
Plotting character of category level point coordinates |
Z.cex |
Size of plotting character for sample points |
CLP.cex |
Size of plotting character for category level point points |
title |
Title of the plot |
If compdat = NULL in evalMeas, only a GPAbin biplot will be constructed.
If a complete data set (compdat) was specified in evalMeas, two biplots will be constructed: (1) Complete MCA biplot and (2) GPAbin biplot.
data(implist) missbp <- missmi(implist)|> DRT() |> GPAbin() |> biplFig()data(implist) missbp <- missmi(implist)|> DRT() |> GPAbin() |> biplFig()
Predicts category levels from an MCA based biplot using the distances between coordinates
CLPpred(CLPs = CLPs, Zs = Zs, p = p, n = n, lvls = lvls, datIN = datIN)CLPpred(CLPs = CLPs, Zs = Zs, p = p, n = n, lvls = lvls, datIN = datIN)
CLPs |
Category level point coordinates |
Zs |
Sample coordinates |
p |
Number of variables |
n |
Number of samples |
lvls |
Names of category levels |
datIN |
Input data from which |
predCL |
Final predicted categorical data set |
Simulated data example
A data frame with 1000 rows and 5 columns.
Variable 1
Variable 2
Variable 3
Variable 4
Variable 5
Simulated data from a uniform distribution that is categorised into levels.
Multiple correspondence analysis is performed on the multiple imputed datasets
DRT(missbp, method = c("MCA"))DRT(missbp, method = c("MCA"))
missbp |
An object of class |
method |
Select a dimension reduction technique. In the current version |
The missbp object is appended with the following objects:
Z |
List of sample coordinates |
CLP |
List of category level point coordinates |
lvls |
List of category level names |
m |
Number of multiple imputations |
data(implist) missbp <- missmi(implist) |> DRT()data(implist) missbp <- missmi(implist) |> DRT()
Calculates measures of comparison based on distances between two configurations in two dimensions.
evalMeas(missbp, compdat = NULL)evalMeas(missbp, compdat = NULL)
missbp |
An object of class |
compdat |
Complete data matrix representing the input data of |
The missbp object is appended with the following objects:
eval |
Returns a data table with five evaluation measures: Procrustes Statistic (PS), Similarity Proportion (SP), Response Profile Recovery (RPR), Absolute Mean Bias (AMB), Root Mean Squared Bias (RMSB) |
GPApred |
A dataframe representing predicted categorical responses from the GPAbin biplot. |
compPred |
A dataframe representing predicted categorical responses from the complete MCA biplot. |
compZs |
Sample coordinates for the MCA biplot of the complete data. |
compCLPs |
CLPs for the MCA biplot of the complete data. |
complvls |
Names of the CLPs for the MCA biplot of the complete data. |
See also missmi, impute, DRT and GPAbin.
For more detail, refer to Nienkemper-Swanepoel, J., le Roux, N. J., & Gardner-Lubbe, S. (2021). GPAbin: unifying visualizations of multiple imputations for missing values. Communications in Statistics - Simulation and Computation, 52(6), 2666–2685. https://doi.org/10.1080/03610918.2021.1914089.
data(compdat) data(implist) missbp <- missmi(implist) |> DRT() |> GPAbin() |> evalMeas(compdat=compdat)data(compdat) data(implist) missbp <- missmi(implist) |> DRT() |> GPAbin() |> evalMeas(compdat=compdat)
Creates a multiple correspondence analysis (MCA) biplot in ggplot.
ggbiplFig( missbp, Z.col = "#61223b", CLP.col = "#b79962", Z.pch = 19, CLP.pch = 15 )ggbiplFig( missbp, Z.col = "#61223b", CLP.col = "#b79962", Z.pch = 19, CLP.pch = 15 )
missbp |
An object of class |
Z.col |
Colour of sample coordinates |
CLP.col |
Colour of category level point coordinates |
Z.pch |
Plotting character of sample coordinates |
CLP.pch |
Plotting character of category level point coordinates |
plotReturns a GPAbin ggplot biplot.
plotCReturns an MCA ggplot biplot of the complete data set, if provided.
data(implist) data(compdat) missbp <- missmi(implist)|> DRT() |> GPAbin() |> evalMeas(compdat = compdat) |> ggbiplFig() ### GPAbin biplot missbp$plot ### MCA biplot missbp$plotCdata(implist) data(compdat) missbp <- missmi(implist)|> DRT() |> GPAbin() |> evalMeas(compdat = compdat) |> ggbiplFig() ### GPAbin biplot missbp$plot ### MCA biplot missbp$plotC
This function contains the OPA function to compare two configurations and the GPA function for multiple configuration comparisons
GPA(Xk, G.target = NULL, iter = 500, eps = 0.001)GPA(Xk, G.target = NULL, iter = 500, eps = 0.001)
Xk |
list containing the testee configurations which is updated on #each iteration |
G.target |
Target configuration. If not specified the centroid configuration will be used as the target |
iter |
Number of iterations allowed before convergence |
eps |
Threshold value for convergence of the alogrithm |
Xk.F |
List containing the updated testee configurations |
sk.F |
Vector containing the final scaling factors |
Qk.F |
List containing the final rotation matrices |
Gmat |
Final target configuration |
sum.sq |
Final minimised sum of squared distance |
Combines multiple configurations from dimension reduction solutions applied to multiple imputed data sets
GPAbin(missbp, G.target = NULL)GPAbin(missbp, G.target = NULL)
missbp |
An object of class |
G.target |
Target configuration. If not specified the centroid configuration will be used as the target. |
The missbp object is appended with the following objects:
Z.GPA.list |
List containing the sample coordinates for each MI after GPA |
CLP.GPA.list |
List containing the CLPs for each MI after GPA |
G.target |
Target configuration |
Z.GPAbin |
Sample coordinates for the GPAbin biplot |
CLP.GPAbin |
CLPs for the GPAbin biplot |
See also missmi, impute and DRT.
For more detail, refer to Nienkemper-Swanepoel, J., le Roux, N. J., & Gardner-Lubbe, S. (2021). GPAbin: unifying visualizations of multiple imputations for missing values. Communications in Statistics - Simulation and Computation, 52(6), 2666–2685. https://doi.org/10.1080/03610918.2021.1914089.
data(implist) missbp <- missmi(implist) |> DRT() |> GPAbin()data(implist) missbp <- missmi(implist) |> DRT() |> GPAbin()
Five multiple imputations of missdat
List containing five multiple imputations of missdat. Each list item a data frame with 1000 rows and 5 columns.
Variable 1
Variable 2
Variable 3
Variable 4
Variable 5
simulated example data imputed with mice::mice(missdat, m=5, method="polyreg", maxit=10, remove.collinear=FALSE, printFlag = FALSE)
Choose between four available multiple imputation strategies in R.
impute(missbp, imp.method = c("MIMCA", "jomo", "DPMPM", "mice"), m = 5)impute(missbp, imp.method = c("MIMCA", "jomo", "DPMPM", "mice"), m = 5)
missbp |
An object of class |
imp.method |
Select one of four imputation methods: |
m |
Number of multiple imputations |
The missbp object is appended with the following object:
dataimp |
List of imputed data |
See also MIMCA, jomo1cat, mi and mice.
data(missdat) missbp <- missmi(missdat) |> impute(imp.method="DPMPM", m=5)data(missdat) missbp <- missmi(missdat) |> impute(imp.method="DPMPM", m=5)
compdat containing approximately 35% simulated missing values according to a missing at random (MAR) missing data mechanism
A data frame with 1000 rows and 5 columns.
Variable 1
Variable 2
Variable 3
Variable 4
Variable 5
Simulated data from a uniform distribution that is categorised into levels.
This function produces a list of elements to be used when producing a GPAbin biplot.
missmi(data)missmi(data)
data |
input data frame or list |
X |
The processed data |
m |
Number of multiple imputations applied |
n |
The number of samples |
p |
The number of variables |
miss_pct |
Percentage of missing values |
data(missdat) missbp <- missmi(missdat) data(implist) missbp <- missmi(implist)data(missdat) missbp <- missmi(missdat) data(implist) missbp <- missmi(implist)
This function performs Orthogonal Procrustes Analysis on centred data
OPA(missbp, compdat, centring = TRUE, dim = "2D")OPA(missbp, compdat, centring = TRUE, dim = "2D")
missbp |
An object of class |
compdat |
Complete data set, only available for simulated data examples. |
centring |
Logical argument to apply centering, default is |
dim |
Number of dimensions to use in final solutions ( |
ProcStat |
Procrustes Statistic |
compZ |
Sample coordinates representing the complete data set |
compCLP |
Category level point coordinates representing the complete data set |
complvls |
Category levels |
compdat |
Complete data set, only available for simulated data examples |
This function is used to print output when the missmi biplot object is created.
## S3 method for class 'missmi' print(x, ...)## S3 method for class 'missmi' print(x, ...)
x |
an object of class |
... |
additional arguments. |
This function will not produce a return value, it is called for side effects.
data(missdat) missbp <- missmi(missdat) data(implist) missbp <- missmi(implist) print(missbp)data(missdat) missbp <- missmi(missdat) data(implist) missbp <- missmi(implist) print(missbp)