plotInd: Plot of Individuals (Experimental Units)

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/plotInd.R

Description

This function provides scatter plots for individuals (experimental units) representation from MIMFA results.

Usage

1
2
3
4
plotInd(object, comp=c(1, 2), colStrata=NULL, colMissing="white",
        confAreas=c("none", "ellipse", "convex.hull"), confLevel=0.95,
        ellipseType=c("norm", "t"), alpha=0.1, lwd=0.3, cex=3,
        legTitle="Strata")

Arguments

object

an object of class MIDTList as returned by MIMFA function.

comp

an integer vector of length two. The components that will be used on the horizontal and the vertical axes respectively to project the individuals.

colStrata

a character vector of the same length than the number of strata containing the color names to be used to annotate the individuals per stratum.

colMissing

the fill color for imputated individuals.

confAreas

a character string indicating whether to plot "none", "ellipse" or "convex.hull" confidence areas.

confLevel

a numerical value indicating the confidence level of ellipses being plotted when confAreas = "ellipse". The default is set to 0.95, for a 95% confidence region.

ellipseType

the type of ellipse. The default "norm" assumes a multivariate normal distribution, and "t" assumes a multivariate t-distribution.

alpha

the alpha transparency for filled color of the confidence areas, values are any numbers from 0 (transparent) to 1 (opaque).

lwd

a positive number. The border line width of the confidence areas.

cex

a positive number. The amount by which plotting symbols should be magnified.

legTitle

character. The legend title.

Details

plotInd function makes scatter plot for individuals representation from MIMFA results. Each point corresponds to an individual. The individuals are colored with rapport to their stratum, whereas imputed individuals are colored according to the colMissing argument.

Multiple imputation generates M imputed datasets and the variance between-imputations reflects the uncertainty associated to the estimation of the missing values. The plotInd function proposes two approaches to visualize the uncertainty due to missing data: confidence ellipses and convex hulls. The idea is to project all the multiple imputed datasets onto the compromise configuration. Each individual is represented by M points, each corresponding to one of the M configurations. Confidence ellipses and convex hulls can then be constructed for the M configurations for each individual. For ease of understanding, not all individuals for the M configurations obtained are plotted.

Confidence ellipses can be created by setting the confAreas argument to "ellipse". The 95% confidence ellipses are showed by default. Convex hulls are plotted by setting the confAreas argument to "convex.hull". The computed convex hull results in a polygon containing all M solutions.

Value

An object of class ggplot.

Author(s)

Ignacio González and Valentin Voillet

See Also

plotVar

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#-- load data and create MIDTList object
data(NCI60)
midt <- MIDTList(NCI60$mae)

#-- performs MIMFA
midt <- MIMFA(midt, ncomp=2, M=10)

#-- default plot
plotInd(midt)

#-- with confidence ellipses
plotInd(midt, confAreas="ellipse")

#-- with convex hull areas
plotInd(midt, confAreas="convex.hull")

GonzalezIgnacio/missRows documentation built on Jan. 16, 2020, 4:11 a.m.