Factor Analysis
In most data analysis problems, there are some quantities that we can observe and some that we cannot. The classic examples come from the social sciences. Suppose that you wanted to measure intelligence. It’s not possible to directly measure an abstract concept like intelligence, but it is possible to measure performance on different tests. You could use factor analysis to analyze a set of test scores (the observed values) to try to determine intelligence (the hidden value).
Factor analysis is available in R through the function factanal
in the stats
package:
factanal(x, factors, data = NULL, covmat = NULL, n.obs = NA, subset, na.action, start = NULL, scores = c("none", "regression", "Bartlett"), rotation = "varimax", control = NULL, ...)
Here is a description of the arguments to factanal
.
Argument | Description | Default |
---|---|---|
x | A formula or a numeric matrix to be used for analysis. | |
factors | A numeric value indicating the number of factors to be fitted. | |
data | A data frame in which to evaluate x (if x is a formula). | NULL |
covmat | A covariance matrix (or a list returned by cov.wt ). | NULL |
n.obs | The number of observations (if covmat is specified). | NA |
subset | Specifies which observations to include in the analysis. | |
na.action | A function that specifies how to handle missing
observations (if x is a
formula). | |
start | A matrix of starting values for the algorithm. | NULL |
scores | A character value specifying the type of scores to produce.
Use scores="none" for no
scores, scores="regression" for Thompson’s scores, or ... |
Get R in a Nutshell, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.