pca.flex: Perform PCA

View source: R/pca.R

pca.flexR Documentation

Perform PCA

Description

Function is based on psych::principal function and in line with Field's Discovering statistics using R. The PCA is performed with listwise deletion and is based on correlation matrix. Due to mystic differences in algorthms, loadings obtained by oblimin rotation are marginally different from those obtained in SPSS...I still don't know why

Usage

pca.flex(
  data,
  form,
  n_factors = "KG",
  rotation = "oblimin",
  title = "",
  sing.solution = T,
  sorted = T,
  supress = 0.3,
  option = r.flex.opts
)

Arguments

data

data frame

form

formula with variables on rhs. E.g. 1 ~ var1 + var2 + var3

n_factors

number of components to extract. There are several methods

  • exact number. Useful for forced single component and experienting

  • "KG" - Kaiser-Guttman criteria (lambda>1)

  • "MAP" - Velicer's Map test

  • "VSS1" - very simple structure complexity 1

  • "VSS2" - very simple structure complexity 2

  • "Parallel" - parallel tests

  • "ScreeAC" - Acceleration factor Scree test

  • "ScreeOC" - Optimal coordinates Scree test

rotation

Rotation to use. Options are: "none", "varimax", "oblimin". Default is "oblimin".

title

Title of analysis. Will be determined if omitted

sing.solution

Should forced single component solution also be presented (default=T)

sorted

should the loadings be sorted in table (default=T)

supress

suppress coefficients below threshold (default=0.3)

option

inherited from r.flex.opts

Value

list with elements

  • type - table type - used for inserting in word document

  • title - used for table title. Can be set manually or automatically

  • preqs - prerequisites - Bartlett and KMO

  • df - results as data.frame

  • table - flextable with results

  • rotation - used rotation

  • sing.solution - is there a forced single component solution

  • extraction - how are components extracted (exact number or criteria) - see nfac.flex function for details


mrajter/rajter.flex documentation built on July 30, 2024, 1:31 a.m.