Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
R in Action, Second Edition.pdf
Скачиваний:
540
Добавлен:
26.03.2016
Размер:
20.33 Mб
Скачать

336

CHAPTER 14 Principal components and factor analysis

Factor Analysis

reading

1

vocab

0.8

PA1

blocks

0.4

0.6

picture

1

0.6

PA2

0.5

general

0.5

Figure 14.6 Diagram of the oblique two-factor solution

maze

for the psychological test data in ability.cov

correlations between the factors. This type of diagram is helpful when there are several factors.

When you’re dealing with data in real life, it’s unlikely that you’d apply factor analysis to a dataset with so few variables. We’ve done it here to keep things manageable. If you’d like to test your skills, try factor-analyzing the 24 psychological tests contained in

Harman74.cor. The code

library(psych)

fa.24tests <- fa(Harman74.cor$cov, nfactors=4, rotate="promax")

should get you started!

14.3.4Factor scores

Compared with PCA, the goal of EFA is much less likely to be the calculation of factor scores. But these scores are easily obtained from the fa() function by including the score = TRUE option (when raw data are available). Additionally, the scoring coefficients (standardized regression weights) are available in the weights element of the object returned.

For the ability.cov dataset, you can obtain the beta weights for calculating the factor score estimates for the two-factor oblique solution using

> fa.promax$weights [,1] [,2] general 0.080 0.210

picture 0.021 0.090 blocks 0.044 0.695 maze 0.027 0.035 reading 0.739 0.044 vocab 0.176 0.039

Unlike component scores, which are calculated exactly, factor scores can only be estimated. Several methods exist. The fa() function uses the regression approach. To learn more about factor scores, see DiStefano, Zhu, and Mîndrila,(2009).

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]