Learn R Programming

SCOUTer (version 1.0.0)

obscontribpanel: obscontribpanel

Description

Information about the Hotelling's T^2 and the Squared Predidiction Error (SPE) of an observation. The term T^2_A makes reference to the T^2 for a model with A principal components (PCs).

Usage

obscontribpanel(pcax, pcaref, obsid = NA)

Arguments

pcax

A list with the elements of the PCA model that will be displayed: SPE, T^2_A and their constributions (E and T2matrix).

pcaref

A list with the PCA model according to which the distance and contributions are expressed.

obsid

Integer with the index of the observation of interest. Default set to NA.

Value

ggplot object with the generated bar plots in a 1 x 4 subplots layout.

Examples

Run this code
# NOT RUN {
X <- as.matrix(X)
pcamodel.ref <- pcamb_classic(X[1:40,], 2, 0.05, "cent") # PCA-MB with first 
# 40 observations
pcaproj <- pcame(X[-c(1:40),], pcamodel.ref) # Project last observations
obscontribpanel(pcaproj, pcamodel.ref, 2) # Information about the SPE and T^2 
# of the row #2
# }

Run the code above in your browser using DataLab