pcaMix: Mixed Principal Components Analysis

Description Usage Arguments Value Examples

View source: R/PCAandFA.R

Description

This function allows you to integrate information about data structure contained in categorical variables in a principal components analysis.

Usage

1
2
3
4
5
6
pcaMix(
  x = NULL,
  cat = NULL,
  ncomp = min(nrow(x) - 1, ncol(x) + ncol(cat)),
  scale = T
)

Arguments

x

a matrix or data frame containing only numeric variables

cat

the categorical variables. must be coded as factors or characters, not numeric dummy variables.

ncomp

the number of components to retain.

scale

should the variables be scaled prior to analysis? Defaults to TRUE.

Value

an object of class PrincipalComp

Examples

1
2
3
x <- Alzheimers[,-c(1,3)] # Get rid of categorical variables for the PCA.
cats <- Alzheimers[,1:3] # Put categorical variables here for the PCA
pcaMix(x, cats) # Run pcaMix

abnormally-distributed/cvreg documentation built on May 3, 2020, 3:45 p.m.