Skip to Content
R in a Nutshell, 2nd Edition
book

R in a Nutshell, 2nd Edition

by Joseph Adler
October 2012
Beginner to intermediate
721 pages
21h 38m
English
O'Reilly Media, Inc.
Content preview from R in a Nutshell, 2nd Edition

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.

ArgumentDescriptionDefault
xA formula or a numeric matrix to be used for analysis. 
factorsA numeric value indicating the number of factors to be fitted. 
dataA data frame in which to evaluate x (if x is a formula).NULL
covmatA covariance matrix (or a list returned by cov.wt).NULL
n.obsThe number of observations (if covmat is specified).NA
subsetSpecifies which observations to include in the analysis. 
na.actionA function that specifies how to handle missing observations (if x is a formula). 
startA matrix of starting values for the algorithm.NULL
scoresA character value specifying the type of scores to produce. Use scores="none" for no scores, scores="regression" for Thompson’s scores, or ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

R in a Nutshell

R in a Nutshell

Joseph Adler
The R Book, 2nd Edition

The R Book, 2nd Edition

Michael J. Crawley
The R Book

The R Book

Michael J. Crawley
R Packages

R Packages

Hadley Wickham

Publisher Resources

ISBN: 9781449358204Errata Page