Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

StatDA (version 1.5)

pfa: Principal Factor Analysis

Description

Computes the principal factor analysis of the input data.

Usage

pfa(x, factors, data = NULL, covmat = NULL, n.obs = NA, subset, na.action,
start = NULL, scores = c("none", "regression", "Bartlett"),
rotation = "varimax", maxiter = 5, control = NULL, ...)

Arguments

x
(robustly) scaled input data
factors
number of factors
data
default value is NULL
covmat
(robustly) computed covariance or correlation matrix
n.obs
number of observations
subset
if a subset is used
start
starting values
scores
which method should be used to calculate the scores
rotation
if a rotation should be made
maxiter
maximum number of iterations
control
default value is NULL
na.action
what to do with NA values
...
arguments for creating a list

Value

  • loadingsA matrix of loadings, one column for each factor. The factors are ordered in decreasing order of sums of squares of loadings.
  • uniqunessuniquness
  • correlationcorrelation matrix
  • criteriaThe results of the optimization: the value of the negativ log-likelihood and information of the iterations used.
  • factorsthe factors
  • dofdegrees of freedom
  • method"principal"
  • n.obsnumber of observations if available, or NA
  • callThe matched call.
  • STATISTIC, PVALThe significance-test statistic and p-value, if can be computed

References

C. Reimann, P. Filzmoser, R.G. Garrett, and R. Dutter: Statistical Data Analysis Explained. Applied Environmental Statistics with R. John Wiley and Sons, Chichester, 2008.

Examples

Run this code
data(moss)
var=c("Ni","Cu","Mg","Rb","Mn")
x=log10(moss[,var])

x.mcd=covMcd(x,cor=TRUE)
x.rsc=scale(x,x.mcd$cent,sqrt(diag(x.mcd$cov)))
pfa(x.rsc,factors=2,covmat=x.mcd,scores="regression",rotation="varimax",
    maxit=0,start=rep(0,ncol(x.rsc)))

Run the code above in your browser using DataLab