fad {fad} | R Documentation |
Factor Analysis for data (high or low dimensional).
Description
Perform fast matrix-free maximum-likelihood factor analysis on a covariance matrix or data matrix, works if number of variables is more than number of observations.
Usage
fad(
x,
factors,
data = NULL,
covmat = NULL,
n.obs = NA,
subset,
na.action,
start = NULL,
scores = c("none", "regression", "Bartlett"),
rotation = "varimax",
control = NULL,
lower = 0.005,
...
)
Arguments
x |
A formula or a numeric matrix or an object that can be coerced to a numeric matrix. |
factors |
The number of factors to be fitted. |
data |
An optional data frame (or similar: see |
covmat |
A covariance matrix, or a covariance list as returned by
|
n.obs |
The number of observations, used if |
subset |
A specification of the cases to be used, if |
na.action |
The |
start |
|
scores |
Type of scores to produce, if any. The default is none,
|
rotation |
character. |
control |
A list of control values:
|
lower |
The lower bound for uniquenesses during optimization. Should be > 0. Default 0.005. |
... |
Components of |
Value
An object of class "fad"
with components
loadings |
A matrix of loadings on the correlation scale, one column for each factor. 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. This is of class |
uniquenesses |
The uniquenesses computed on the correlation scale. |
sd |
The estimated standard deviations. |
criteria |
The results of the optimization: the value of the criterion (a linear function of the negative log-likelihood) and information on the iterations used. |
factors |
The argument |
dof |
The number of degrees of freedom of the factor analysis model. |
method |
The method: always |
rotmat |
The rotation matrix if relevant. |
scores |
If requested, a matrix of scores. |
n.obs |
The number of observations if available, or |
call |
The matched call. |
na.action |
If relevant. |
loglik , BIC |
The maximum log-likelihood and the Bayesian Information Criteria. |
See Also
Examples
set.seed(1234)
## Simulate a 200 x 3 loadings matrix ~i.i.d N(0,1)
L <- matrix(rnorm(200*3),200,3)
## Simulate the uniquenesses i.i.d U(0.2,0.9)
D <- runif(200,0.2,0.9)
## Generate a data matrix of size 50 x 200 with rows
## ~i.i.d. N(0,LL'+diag(D))
X <- tcrossprod(matrix(rnorm(50*3),50,3),L) + matrix(rnorm(50*200),50,200) %*% diag(sqrt(D))
## Fit a factor model with 3 factors:
fit = fad(X,3)
## Print the loadings:
print(fit$loadings)