factanalDAS {DASplusR}R Documentation

Factor Analysis

Description

Performs principal factor analysis on the given variables of a data set. The results are returned as an object of class "factanal".

Usage

factanalDAS(data, vars, logVars = character(), subset, 
            factors, robust = NULL, covmat = NULL, 
            start = NULL, rotation = "varimax", 
            scores = c("none", "regression", "Bartlett"), 
            control = NULL, ...)

Arguments

data A data object of class "DASData" or "data.frame".
vars A vector for selecting columns (variables) of data. It can be either a character vector containing the variable names, a numeric vector containing the column numbers or a logical vector. All columns are used if this is missing.
logVars A vector specifying the columns (variables) of data to be log-transformed, therefore it must be a subset of vars. This, too, can be either a character vector containing the variable names, a numeric vector containing the column numbers or a logical vector.
subset A vector for selecting the rows (observations) of data. Again, either a character, numeric or logical vector can be used.
factors The number of factors to be fitted.
robust The name of a function for computing a robust estimate of the covariance matrix as a character string, e.g., "covMcd" for MCD estimation and "covOGK" for OGK estimation. It is also possible to supply the function itself. In any case, the function must have a matrix or a data frame as its first argument and should return a matrix, or a list that contains elements named center (an estimate for the central location) and cov (an estimate for the covariance matrix). Scores cannot be computed if a matrix is returned. This argument is ignored if covmat is supplied, too.
covmat A covariance matrix, or a covariance list as returned by cov.wt (or covMcd from package robustbase). If supplied, the arguments logVars and robust are ignored. Make sure that the same data is defined by data and vars that has been used for calculating covmat. Scores can only be computed if covmat is a covariance list that also contains an estimate of the central location of the data.
start A numeric vector giving the initial set of uniquenesses.
rotation A character string specifying the rotation method to be applied to the factors, if any. It must be either "none", or the name of a rotation function, e.g., the standard R functions "varimax" and "promax". Self-programmed functions must have the loadings matrix as its first argument and should return a list with an element named loadings giving the rotated loadings, or just the rotated loadings.
scores The type of scores to be calculated, also a character string. No scores are produced with "none", which is the default. "Bartlett" gives Bartlett's weighted least-squares scores and "regression" indicates Thomson's regression scores. Partial matching allows these names to be abbreviated. Calculating the scores is only possible if data and vars are supplied.
control A list of control values, which can contain the following elements:
maxiter
The maximum number of iterations to be performed in PFA. The default is 5.
robargs
A list of additional arguments to be passed to the function given by robust. The names of the list elements should correspond to the argument names.
rotate
A list of additional arguments for the rotation function.
... The list elements of control can also be supplied as named arguments.

Details

Observations that contain missing values are removed before computing the factors.

The number of degrees of freedom d of the factor analysis model is defined as

d := 1/2 * ((p-k)^2 - p-k),

where p denotes the number of variables entering FA and k the number of factors to be fitted. The maximum number of factors is thus given by the restriction d >= 0 on the degrees of freedom.

Note that the correlation matrix is always used to compute the factors. Thus, the computation fails if there are constant variables.

Value

factanalDAS returns an object of class "factanal" that contains the following elements:

loadings A matrix of loadings, one column for each factor. This is of class "loadings": see loadings for its print method. The factors are ordered in decreasing order of sums of squares of loadings, and given the sign that will make the sum of the loadings positive.
uniquenesses The uniquenesses computed (i.e., the proportions of variability of the variables that are not included in the factors).
correlation The correlation matrix.
criteria The results of the optimization: the number of iterations performed.
factors The number of factors.
dof The number of degrees of freedom in the factor analysis model.
method The method of factor analysis: always "principal".
scores If requested, a matrix of scores.
n.obs The number of observations.
call The matched function call.
STATISTIC, PVAL The significance test statistic and p-value, if it can be computed.

Note

There are so many variations on factor analysis that it is hard to compare output from different programs. For example, the standard R function factanal performs maximum-likelihood factor analysis, which requires multivariate normally distributed data.

Author(s)

Andreas Alfons <andreas.alfons@student.tuwien.ac.at>

References

Bartlett, M. S. (1937) The statistical conception of mental factors. British Journal of Psychology, 28, 97–104.

Lawley, D.N. and Maxwell, A.E. (1971) Factor Analysis as a Statistical Method, 2nd edition. Butterworths.

Mardia, K.V., Kent, J.T. and Bibby, J.M. (1979) Multivariate Analysis. Academic Press.

Johnson, R.A. and Wichern, D.W. (2002) Applied Multivariate Statistical Analysis. Prentice Hall. 5th edition.

Reimann, C., Filzmoser, P., Garrett, R.G. and Dutter, R. (2008) Statistical Data Analysis Explained. Wiley & Sons.

See Also

DAS+R functions: FactanalGUI, factplot, biplotDAS, princompDAS.
R functions: factanal, varimax, covMcd, covOGK.

Examples

  ## KOLA95_Moss data
  data(KOLA95_MOSS)
  factanalDAS(data = KOLA95_MOSS, 
    vars = c("Cu","Mg","Mn","Ni","Rb","Th"), 
    logVars = c("Cu","Mg","Mn","Ni","Rb","Th"), 
    factors = 3, robust = "covMcd", 
    scores = "regression")

[Package DASplusR version 0.0-2 Index]