pcabootAG: PCA and Bootstrapping

Description Usage Arguments Value Examples

View source: R/pcabootAG.R

Description

This is a function for the PCA bootstrapping assignment. It performs bootstrapping on the eigenvalues and eigenvectors of either the sample covariance (S) or the sample correlation (R), then it outputs plots of the bootstrapped estimates, as well as confidence intervals. It also outputs Anderson and Girschick confidence intervals for the λ values

Usage

1
pcabootAG(data, alpha, iter, cov = TRUE)

Arguments

data

a data frame

alpha

the significance level

iter

the number of iterations to use when bootstrapping

cov

a boolean for if we want to use S (cov = TRUE) or R (cov = FALSE) for the analysis

Value

a barplot for the bootstrapped values of each λ[i]

a violin plot for the bootstrapped values for each e_ik, i,k = 1,2,...p, where p is the number of variables

a list containing confidence intervals for each λ[i] and e_ik, i,k = 1,2,...p from bootstrapping, and confidence intervals for each λ[i] using the Anderson and Gerschick method

Examples

1
2
data <- as.data.frame(datasets::mtcars)
pcabootAG(data[,1:3], alpha = 0.05, iter = 100)

leahpom/MATH5793POMERANTZ documentation built on May 10, 2021, 9:52 a.m.