This function provides visual diagnostic tools for assessing multiply imputed datasets created with 'mixgb' or other imputers through inspecting the distributional characteristics of imputed variables. It supports 1D, 2D, and 3D visualisations for numeric and categorical variables using either interactive or static plots.
Arguments
- data
A data frame containing the original data with missing values.
- imp_list
A list of imputed data frames.
- x
A character string specifying the name of the variable to plot on the x axis. Default is NULL.
- y
A character string specifying the name of the variable to plot on the y axis. Default is NULL.
- z
A character string specifying the name of the variable to plot on the z axis. Default is NULL.
- m
An integer specifying the number of imputed datasets used for visualisation. It should be smaller than
length(imp_list). Default is NULL (plot all).- imp_idx
A vector of integers specifying the indices of imputed datasets to plot. Default is NULL (plot all).
- interactive
A logical value indicating whether to create an interactive plotly plot (TRUE by default) or a static ggplot2 plot (FALSE).
- integerAsFactor
A logical value indicating whether to treat integer variables as factors (TRUE) or numeric (FALSE). Default is FALSE.
- title
A string specifying the title of the plot. Default is "auto" (automatic title based on
x,y,zinput). If NULL, no title is shown.- subtitle
A string specifying the subtitle of the plot. Default is "auto" (automatic subtitle based on
x,y,zinput). If NULL, no subtitle is shown.- color_pal
A named vector of colors for different imputation sets. If NULL (default), a default color palette is used.
- plotly_style
A named list of style overrides for interactive (
interactive = TRUE) plots. Unrecognised keys are silently ignored. Default islist()(use all defaults). Valid keys:title_sizeTitle font size (default 20).
title_colorTitle colour (default
"#242429").title_fontTitle font family (default
"Helvetica, Arial, sans-serif").axis_title_sizeAxis title font size (default 14).
axis_title_fontAxis title font family (default
"Arial Black").axis_title_colorAxis title colour (default
"#35353d").plot_bgcolorBackground colour of the plot area (default
"#f2f7fc").paper_bgcolorBackground colour of the full figure (default
"#fff").gridcolorGrid line colour (default
"#999").
Additional keys for 3D numeric plots (
x,y,zall numeric):scene3d_domain_xNumeric vector of length 2 defining the horizontal extent of the 3D scene on the paper (default
c(0, 1), full width).scene3d_domain_yNumeric vector of length 2 defining the vertical extent of the 3D scene on the paper (default
c(0.05, 0.95)).scene3d_title_yVertical position of the title in paper coordinates (default
0.9). Decrease to move the title down and reduce the gap between the title and the 3D box.scene3d_margin_tTop margin in pixels (default
0).scene3d_margin_rRight margin in pixels (default
0).scene3d_margin_bBottom margin in pixels (default
0).scene3d_margin_lLeft margin in pixels (default
0).scene3d_eye_xCamera eye x position (default
1.25). Negative values flip the viewing direction.scene3d_eye_yCamera eye y position (default
1.25).scene3d_eye_zCamera eye z position (default
1.25). Smaller values lower the viewing angle; values near0give a near-horizontal view.
- gg_style
A named list of style overrides for static (
interactive = FALSE) plots. Unrecognised keys are silently ignored. Default islist()(use all defaults). Valid keys:gg_title_sizeTitle font size (default 14).
gg_title_faceTitle font face, e.g.
"bold"(default).title_colorTitle colour (default
"#242429").gg_subtitle_sizeSubtitle font size (default 14).
gg_subtitle_faceSubtitle font face (default
"plain").subtitle_colorSubtitle colour (default
"#242429").gg_axis_title_sizeAxis title font size (default 10).
gg_axis_title_faceAxis title font face (default
"bold").axis_title_colorAxis title colour (default
"#35353d").gg_axis_text_sizeAxis tick label font size (default 9).
panel_bg_fillPanel background fill colour (default
"gray95").panel_bg_colorPanel background border colour (default
NA).strip_bg_fillFacet strip background fill (default
"gray85").strip_bg_colorFacet strip background border colour (default
NA).grid_major_colorMajor grid line colour (default
"white").grid_major_linewidthMajor grid line width (default
0.3).grid_minor_colorMinor grid line colour (default
"white").grid_minor_linewidthMinor grid line width (default
0.2).
- marginal_x
A character string specifying the type of marginal plot to add for the x variable in 2D plots. Options are "hist", "box", "rug", "box+rug"(default), or NULL when interactive = TRUE. Options are "box", "rug", "box+rug"(default), or NULL when interactive = FALSE.
- marginal_y
A character string specifying the type of marginal plot to add for the y variable in 2D plots. Options are "hist", "box", "rug", "box+rug", or NULL (default, no marginal plot) when interactive = TRUE. Options are "box", "rug", "box+rug", or NULL (default, no marginal plot) when interactive = FALSE.
- verbose
A logical value indicating whether to print extra information. Default is FALSE.
- ...
Additional arguments passed to the underlying plotting functions, such as point_size, alpha, nbins, width, and boxpoints.

