Always do this first!

library(psych)
library(psychTools)

Factor analysis as a data description tool

Notes to accompany https://personality-project.org/courses/350/350.factoranalysis.pdf

Iterative fit

• Specifying a model and loss function

• Ideally supplying a first derivative to the loss function

• Can be done empirically

• Some way to evaluate the quality of the fit

• Minimization of function, but then how good is this minimum

Multivariate models

• Many procedures use this concept of iterative fitting

• Some, such as principal components are“closed form”and can just be solved directly

• Others, such as“factor analysis”need to find solutions by successive approximations

• The issue of factor or component rotation is an iterative procedure.

• Principal Components and Factor analysis are all the result of some basic matrix equations to approximate a matrix

• Conceptually, we are just taking the square root of a correlation matrix:

• R≈CC′ or R≈FF′+U2

• For any given correlation matrix, R, can we find a C or an F matrix which approximates it?

##simulate a correlation matrix

 R <- sim.congeneric()  #use the default values 
 R
##      V1   V2   V3   V4
## V1 1.00 0.56 0.48 0.40
## V2 0.56 1.00 0.42 0.35
## V3 0.48 0.42 1.00 0.30
## V4 0.40 0.35 0.30 1.00

This looks like a simple multiplication table. See if we can factor it

f1 <- fa(R)  #defaults to 1 factor
f1   #show the output
## Factor Analysis using method =  minres
## Call: fa(r = R)
## Standardized loadings (pattern matrix) based upon correlation matrix
##    MR1   h2   u2 com
## V1 0.8 0.64 0.36   1
## V2 0.7 0.49 0.51   1
## V3 0.6 0.36 0.64   1
## V4 0.5 0.25 0.75   1
## 
##                 MR1
## SS loadings    1.74
## Proportion Var 0.43
## 
## Mean item complexity =  1
## Test of the hypothesis that 1 factor is sufficient.
## 
## The degrees of freedom for the null model are  6  and the objective function was  0.9
## The degrees of freedom for the model are 2  and the objective function was  0 
## 
## The root mean square of the residuals (RMSR) is  0 
## The df corrected root mean square of the residuals is  0 
## 
## Fit based upon off diagonal values = 1
## Measures of factor score adequacy             
##                                                    MR1
## Correlation of (regression) scores with factors   0.89
## Multiple R square of scores with factors          0.78
## Minimum correlation of possible factor scores     0.57

We can find the residuals by caculation

F <- f1$loadings
F
## 
## Loadings:
##    MR1
## V1 0.8
## V2 0.7
## V3 0.6
## V4 0.5
## 
##                  MR1
## SS loadings    1.740
## Proportion Var 0.435
model <- F %*% t(F)   #The factor model is that R = FF'
model   #too many decimals
##           V1        V2        V3        V4
## V1 0.6399993 0.5599976 0.4800018 0.4000001
## V2 0.5599976 0.4899963 0.4200002 0.3499989
## V3 0.4800018 0.4200002 0.3600031 0.3000015
## V4 0.4000001 0.3499989 0.3000015 0.2500003
round(model,2) #this looks better
##      V1   V2   V3   V4
## V1 0.64 0.56 0.48 0.40
## V2 0.56 0.49 0.42 0.35
## V3 0.48 0.42 0.36 0.30
## V4 0.40 0.35 0.30 0.25
round(R - model,2)  #show the resduals
##      V1   V2   V3   V4
## V1 0.36 0.00 0.00 0.00
## V2 0.00 0.51 0.00 0.00
## V3 0.00 0.00 0.64 0.00
## V4 0.00 0.00 0.00 0.75

Or, we can ask for the residuals

resid(f1)
##    V1   V2   V3   V4  
## V1 0.36               
## V2 0.00 0.51          
## V3 0.00 0.00 0.64     
## V4 0.00 0.00 0.00 0.75

Some example data sets

We have a number of nice example sets. Use the help function to find them. ?ability

?bfi

?sai

?msqR

?spi

The number of factor problems

No right answer

  1. Statistical

• Extracting factors until the χ2 of the residual matrix is not significant.

• Extracting factors until the change in χ2 from factor n to factor n+1 is not significant.

  1. Rules of Thumb

• Parallel Extracting factors until the eigenvalues of the real data are less than the corresponding eigenvalues of a random data set of the same size (parallel analysis)

• Plotting the magnitude of the successive eigenvalues and applying the scree test.

  1. Interpretability

• Extracting factors as long as they are interpretable.

• Using the Very Simple Structure Criterion (VSS)

• Using the Minimum Average Partial criterion (MAP).

  1. Eigen Value of 1 rule

Simulations as way of knowing `Truth’

  1. With real data, we do not know ‘truth’

  2. With simulated data, we can know the right answer

  3. Lets examine the sim item function

• defaults to certain parameter values

• processes the data (make it up)

• returns values

  1. Simulations can default to certain values but allow you to specify other values
sim.item  #to show a function, just type the name
## function (nvar = 72, nsub = 500, circum = FALSE, xloading = 0.6, 
##     yloading = 0.6, gloading = 0, xbias = 0, ybias = 0, categorical = FALSE, 
##     low = -3, high = 3, truncate = FALSE, cutpoint = 0) 
## {
##     avloading <- (xloading + yloading)/2
##     errorweight <- sqrt(1 - (avloading^2 + gloading^2))
##     g <- rnorm(nsub)
##     truex <- rnorm(nsub) * xloading + xbias
##     truey <- rnorm(nsub) * yloading + ybias
##     if (circum) {
##         radia <- seq(0, 2 * pi, len = nvar + 1)
##         rad <- radia[which(radia < 2 * pi)]
##     }
##     else rad <- c(rep(0, nvar/4), rep(pi/2, nvar/4), rep(pi, 
##         nvar/4), rep(3 * pi/2, nvar/4))
##     error <- matrix(rnorm(nsub * (nvar)), nsub)
##     trueitem <- outer(truex, cos(rad)) + outer(truey, sin(rad))
##     item <- gloading * g + trueitem + errorweight * error
##     if (categorical) {
##         item = round(item)
##         item[(item <= low)] <- low
##         item[(item > high)] <- high
##     }
##     if (truncate) {
##         item[item < cutpoint] <- 0
##     }
##     colnames(item) <- paste("V", 1:nvar, sep = "")
##     return(item)
## }
## <bytecode: 0x7fd1ea8374e0>
## <environment: namespace:psych>

This simulates with two basic options and a host of other options

simple structure versus circumplex structure

set.seed(42)
my.data <- sim.item(12)
describe(my.data)  #to see what they look like
##     vars   n  mean   sd median trimmed  mad   min  max range  skew kurtosis   se
## V1     1 500  0.01 1.01   0.03    0.01 0.97 -3.26 3.44  6.69  0.05     0.13 0.04
## V2     2 500  0.00 1.00   0.00    0.00 1.05 -3.16 3.12  6.28  0.02    -0.14 0.04
## V3     3 500 -0.03 1.05  -0.04   -0.04 1.06 -2.95 2.80  5.76  0.10    -0.28 0.05
## V4     4 500 -0.05 0.99  -0.04   -0.04 0.96 -2.96 2.82  5.78 -0.06     0.10 0.04
## V5     5 500 -0.04 0.96  -0.05   -0.05 0.96 -2.76 2.71  5.47  0.07    -0.20 0.04
## V6     6 500 -0.05 1.04  -0.06   -0.06 1.03 -3.65 3.07  6.72  0.05     0.09 0.05
## V7     7 500  0.01 0.97   0.01    0.02 0.95 -3.45 3.53  6.98 -0.13     0.38 0.04
## V8     8 500  0.02 1.04   0.02    0.02 1.09 -2.94 3.95  6.89  0.06     0.05 0.05
## V9     9 500  0.04 1.04  -0.02    0.04 1.05 -3.07 2.78  5.85  0.04    -0.25 0.05
## V10   10 500  0.04 0.98   0.10    0.07 0.97 -2.75 2.47  5.22 -0.23    -0.15 0.04
## V11   11 500 -0.01 0.98  -0.03   -0.01 1.02 -3.31 2.88  6.19 -0.01    -0.02 0.04
## V12   12 500 -0.01 0.97   0.00   -0.01 0.91 -3.04 2.57  5.61 -0.08     0.15 0.04
lowerCor(my.data)
##     V1    V2    V3    V4    V5    V6    V7    V8    V9    V10   V11   V12  
## V1   1.00                                                                  
## V2   0.36  1.00                                                            
## V3   0.38  0.37  1.00                                                      
## V4  -0.01 -0.04 -0.01  1.00                                                
## V5   0.05 -0.02  0.01  0.34  1.00                                          
## V6   0.03  0.01  0.01  0.37  0.35  1.00                                    
## V7  -0.35 -0.37 -0.38 -0.09 -0.01 -0.05  1.00                              
## V8  -0.40 -0.34 -0.39  0.00  0.08  0.11  0.34  1.00                        
## V9  -0.41 -0.36 -0.32  0.00  0.02 -0.03  0.32  0.39  1.00                  
## V10  0.06  0.07  0.01 -0.33 -0.32 -0.39 -0.04 -0.11 -0.06  1.00            
## V11  0.02  0.03  0.05 -0.37 -0.35 -0.32  0.02 -0.12 -0.01  0.41  1.00      
## V12  0.01  0.01 -0.11 -0.31 -0.30 -0.33  0.08 -0.02  0.00  0.36  0.39  1.00
corPlot(my.data)  #to see it graphically

## Try parallel analysis

One way to see how many factors are in the data is to compare how well many alternative models fit.

parallel analysis simulates the data with no factors and compares factor solutions to simulated (0 factor) data to the observed solution. When the random data solution is better than the real solution, you have gone too far.

fa.parallel(my.data)

## Parallel analysis suggests that the number of factors =  2  and the number of components =  2

This suggests 2 factors (which is correct, since that is how we made the data)

Try a 2 factor solution

f2 <- fa(my.data,nfactors=2)
## Loading required namespace: GPArotation
f2
## Factor Analysis using method =  minres
## Call: fa(r = my.data, nfactors = 2)
## Standardized loadings (pattern matrix) based upon correlation matrix
##       MR1   MR2   h2   u2 com
## V1   0.64 -0.02 0.41 0.59 1.0
## V2   0.59  0.02 0.35 0.65 1.0
## V3   0.61 -0.04 0.37 0.63 1.0
## V4   0.03 -0.58 0.34 0.66 1.0
## V5   0.01 -0.55 0.30 0.70 1.0
## V6   0.03 -0.60 0.36 0.64 1.0
## V7  -0.58  0.08 0.34 0.66 1.0
## V8  -0.62 -0.10 0.39 0.61 1.1
## V9  -0.59  0.00 0.35 0.65 1.0
## V10  0.07  0.61 0.38 0.62 1.0
## V11  0.03  0.63 0.39 0.61 1.0
## V12 -0.06  0.57 0.33 0.67 1.0
## 
##                        MR1  MR2
## SS loadings           2.21 2.12
## Proportion Var        0.18 0.18
## Cumulative Var        0.18 0.36
## Proportion Explained  0.51 0.49
## Cumulative Proportion 0.51 1.00
## 
##  With factor correlations of 
##      MR1  MR2
## MR1 1.00 0.04
## MR2 0.04 1.00
## 
## Mean item complexity =  1
## Test of the hypothesis that 2 factors are sufficient.
## 
## The degrees of freedom for the null model are  66  and the objective function was  2.52 with Chi Square of  1246.71
## The degrees of freedom for the model are 43  and the objective function was  0.11 
## 
## The root mean square of the residuals (RMSR) is  0.03 
## The df corrected root mean square of the residuals is  0.03 
## 
## The harmonic number of observations is  500 with the empirical chi square  43.95  with prob <  0.43 
## The total number of observations was  500  with Likelihood Chi Square =  54.57  with prob <  0.11 
## 
## Tucker Lewis Index of factoring reliability =  0.985
## RMSEA index =  0.023  and the 90 % confidence intervals are  0 0.04
## BIC =  -212.66
## Fit based upon off diagonal values = 0.99
## Measures of factor score adequacy             
##                                                    MR1  MR2
## Correlation of (regression) scores with factors   0.88 0.88
## Multiple R square of scores with factors          0.78 0.77
## Minimum correlation of possible factor scores     0.56 0.53
fa.sort(f2)  #a cleaner output
## Factor Analysis using method =  minres
## Call: fa(r = my.data, nfactors = 2)
## Standardized loadings (pattern matrix) based upon correlation matrix
##       MR1   MR2   h2   u2 com
## V1   0.64 -0.02 0.41 0.59 1.0
## V8  -0.62 -0.10 0.39 0.61 1.1
## V3   0.61 -0.04 0.37 0.63 1.0
## V2   0.59  0.02 0.35 0.65 1.0
## V9  -0.59  0.00 0.35 0.65 1.0
## V7  -0.58  0.08 0.34 0.66 1.0
## V11  0.03  0.63 0.39 0.61 1.0
## V10  0.07  0.61 0.38 0.62 1.0
## V6   0.03 -0.60 0.36 0.64 1.0
## V4   0.03 -0.58 0.34 0.66 1.0
## V12 -0.06  0.57 0.33 0.67 1.0
## V5   0.01 -0.55 0.30 0.70 1.0
## 
##                        MR1  MR2
## SS loadings           2.21 2.12
## Proportion Var        0.18 0.18
## Cumulative Var        0.18 0.36
## Proportion Explained  0.51 0.49
## Cumulative Proportion 0.51 1.00
## 
##  With factor correlations of 
##      MR1  MR2
## MR1 1.00 0.04
## MR2 0.04 1.00
## 
## Mean item complexity =  1
## Test of the hypothesis that 2 factors are sufficient.
## 
## The degrees of freedom for the null model are  66  and the objective function was  2.52 with Chi Square of  1246.71
## The degrees of freedom for the model are 43  and the objective function was  0.11 
## 
## The root mean square of the residuals (RMSR) is  0.03 
## The df corrected root mean square of the residuals is  0.03 
## 
## The harmonic number of observations is  500 with the empirical chi square  43.95  with prob <  0.43 
## The total number of observations was  500  with Likelihood Chi Square =  54.57  with prob <  0.11 
## 
## Tucker Lewis Index of factoring reliability =  0.985
## RMSEA index =  0.023  and the 90 % confidence intervals are  0 0.04
## BIC =  -212.66
## Fit based upon off diagonal values = 0.99
## Measures of factor score adequacy             
##                                                    MR1  MR2
## Correlation of (regression) scores with factors   0.88 0.88
## Multiple R square of scores with factors          0.78 0.77
## Minimum correlation of possible factor scores     0.56 0.53
fa.diagram(f2) #show the structure

corPlot(fa.sort(f2))

fa.plot(f2)

Lets simulate another structure that does not have simple structure

set.seed(47)  #reset the seed for reproducibility
my.circ <- sim.item(12,circum=TRUE)
describe(my.circ)
##     vars   n  mean   sd median trimmed  mad   min  max range  skew kurtosis   se
## V1     1 500 -0.03 1.00  -0.05   -0.03 1.06 -2.51 2.59  5.09  0.06    -0.42 0.04
## V2     2 500 -0.06 0.98   0.02   -0.03 0.95 -3.57 3.33  6.90 -0.28     0.24 0.04
## V3     3 500 -0.13 1.01  -0.12   -0.15 1.10 -3.01 3.22  6.23  0.17    -0.07 0.05
## V4     4 500 -0.12 0.99  -0.16   -0.16 1.07 -2.43 3.50  5.93  0.36     0.08 0.04
## V5     5 500 -0.04 0.99  -0.05   -0.04 0.99 -2.93 3.93  6.86  0.16     0.38 0.04
## V6     6 500 -0.06 1.06  -0.06   -0.05 0.99 -3.09 3.46  6.56 -0.05     0.15 0.05
## V7     7 500  0.02 1.06   0.02    0.03 1.04 -3.41 3.51  6.92 -0.06     0.24 0.05
## V8     8 500  0.07 1.01   0.06    0.06 0.95 -2.73 3.44  6.17  0.19     0.25 0.05
## V9     9 500  0.06 1.04   0.09    0.05 1.01 -3.65 3.19  6.83  0.07     0.20 0.05
## V10   10 500  0.05 1.02   0.01    0.06 1.07 -4.29 2.76  7.05 -0.19     0.27 0.05
## V11   11 500  0.05 0.98   0.01    0.05 0.94 -3.08 3.26  6.34  0.04     0.01 0.04
## V12   12 500  0.01 1.03   0.06    0.01 1.02 -3.17 2.81  5.99 -0.03    -0.02 0.05
corPlot(my.circ)

How many factors? (we put in two, do we get that back)

fa.parallel(my.circ)

## Parallel analysis suggests that the number of factors =  2  and the number of components =  2

extract 2 factors

f2.circ <- fa(my.circ,2) #note that we know that the second parameter is nfactors
fa.sort(f2.circ)
## Factor Analysis using method =  minres
## Call: fa(r = my.circ, nfactors = 2)
## Standardized loadings (pattern matrix) based upon correlation matrix
##       MR1   MR2   h2   u2 com
## V1   0.60 -0.22 0.42 0.58 1.3
## V2   0.59  0.15 0.37 0.63 1.1
## V8  -0.58 -0.09 0.34 0.66 1.0
## V7  -0.58  0.10 0.35 0.65 1.1
## V3   0.49  0.40 0.38 0.62 1.9
## V12  0.48 -0.40 0.40 0.60 1.9
## V9  -0.46 -0.37 0.33 0.67 1.9
## V5  -0.09  0.66 0.45 0.55 1.0
## V4   0.11  0.63 0.40 0.60 1.1
## V11  0.11 -0.58 0.35 0.65 1.1
## V10 -0.21 -0.54 0.33 0.67 1.3
## V6  -0.42  0.45 0.39 0.61 2.0
## 
##                        MR1  MR2
## SS loadings           2.32 2.20
## Proportion Var        0.19 0.18
## Cumulative Var        0.19 0.38
## Proportion Explained  0.51 0.49
## Cumulative Proportion 0.51 1.00
## 
##  With factor correlations of 
##       MR1   MR2
## MR1  1.00 -0.04
## MR2 -0.04  1.00
## 
## Mean item complexity =  1.4
## Test of the hypothesis that 2 factors are sufficient.
## 
## The degrees of freedom for the null model are  66  and the objective function was  2.73 with Chi Square of  1348.83
## The degrees of freedom for the model are 43  and the objective function was  0.11 
## 
## The root mean square of the residuals (RMSR) is  0.03 
## The df corrected root mean square of the residuals is  0.03 
## 
## The harmonic number of observations is  500 with the empirical chi square  42.45  with prob <  0.5 
## The total number of observations was  500  with Likelihood Chi Square =  54.8  with prob <  0.11 
## 
## Tucker Lewis Index of factoring reliability =  0.986
## RMSEA index =  0.023  and the 90 % confidence intervals are  0 0.04
## BIC =  -212.43
## Fit based upon off diagonal values = 0.99
## Measures of factor score adequacy             
##                                                    MR1  MR2
## Correlation of (regression) scores with factors   0.89 0.88
## Multiple R square of scores with factors          0.79 0.78
## Minimum correlation of possible factor scores     0.58 0.57
fa.diagram(f2.circ)

corPlot(fa.sort(f2.circ))

fa.plot(f2.circ)

Compare the two plots

par(mfrow=c(1,2)) #make a two column plot
fa.plot(f2,title="simple structure")
fa.plot(f2.circ,title = "circumplex structure")

par(mfrow=c(1,1)) #return to 1 column plots

Do real data show circumplex structure?

Yes, mood.

f2 <- fa(msqR[1:72],2)
fa.plot(f2,labels=colnames(msqR)[1:72],title="2 dimensions of affect at the item level")

Do that graph again, but omit the points, just show the labels

fa.plot(f2,labels=colnames(msqR)[1:72],title="2 dimensions of affect at the item level",show.points=FALSE)

### Real data (continued)

The ability data set has 1525 participants taking 16 ability items

describe(ability)
##           vars    n mean   sd median trimmed mad min max range  skew kurtosis   se
## reason.4     1 1442 0.68 0.47      1    0.72   0   0   1     1 -0.75    -1.44 0.01
## reason.16    2 1463 0.73 0.45      1    0.78   0   0   1     1 -1.02    -0.96 0.01
## reason.17    3 1440 0.74 0.44      1    0.80   0   0   1     1 -1.08    -0.84 0.01
## reason.19    4 1456 0.64 0.48      1    0.68   0   0   1     1 -0.60    -1.64 0.01
## letter.7     5 1441 0.63 0.48      1    0.67   0   0   1     1 -0.56    -1.69 0.01
## letter.33    6 1438 0.61 0.49      1    0.63   0   0   1     1 -0.43    -1.82 0.01
## letter.34    7 1455 0.64 0.48      1    0.68   0   0   1     1 -0.59    -1.65 0.01
## letter.58    8 1438 0.47 0.50      0    0.46   0   0   1     1  0.12    -1.99 0.01
## matrix.45    9 1458 0.55 0.50      1    0.56   0   0   1     1 -0.20    -1.96 0.01
## matrix.46   10 1470 0.57 0.50      1    0.59   0   0   1     1 -0.28    -1.92 0.01
## matrix.47   11 1465 0.64 0.48      1    0.67   0   0   1     1 -0.57    -1.67 0.01
## matrix.55   12 1459 0.39 0.49      0    0.36   0   0   1     1  0.45    -1.80 0.01
## rotate.3    13 1456 0.20 0.40      0    0.13   0   0   1     1  1.48     0.19 0.01
## rotate.4    14 1460 0.22 0.42      0    0.15   0   0   1     1  1.34    -0.21 0.01
## rotate.6    15 1456 0.31 0.46      0    0.27   0   0   1     1  0.80    -1.35 0.01
## rotate.8    16 1460 0.19 0.39      0    0.12   0   0   1     1  1.55     0.41 0.01
lowerCor(ability)
##           rsn.4 rs.16 rs.17 rs.19 ltt.7 lt.33 lt.34 lt.58 mt.45 mt.46 mt.47 mt.55 rtt.3 rtt.4
## reason.4  1.00                                                                               
## reason.16 0.28  1.00                                                                         
## reason.17 0.40  0.32  1.00                                                                   
## reason.19 0.30  0.25  0.34  1.00                                                             
## letter.7  0.28  0.27  0.29  0.25  1.00                                                       
## letter.33 0.23  0.20  0.26  0.25  0.34  1.00                                                 
## letter.34 0.29  0.26  0.29  0.27  0.40  0.37  1.00                                           
## letter.58 0.29  0.21  0.29  0.25  0.33  0.28  0.32  1.00                                     
## matrix.45 0.25  0.18  0.20  0.22  0.20  0.20  0.21  0.19  1.00                               
## matrix.46 0.25  0.18  0.24  0.18  0.24  0.23  0.27  0.21  0.33  1.00                         
## matrix.47 0.24  0.24  0.27  0.23  0.27  0.23  0.30  0.23  0.24  0.23  1.00                   
## matrix.55 0.16  0.15  0.16  0.15  0.14  0.17  0.14  0.23  0.21  0.14  0.21  1.00             
## rotate.3  0.23  0.16  0.17  0.18  0.18  0.17  0.19  0.24  0.16  0.15  0.20  0.18  1.00       
## rotate.4  0.25  0.20  0.20  0.21  0.23  0.21  0.21  0.27  0.17  0.17  0.20  0.18  0.53  1.00 
## rotate.6  0.25  0.20  0.27  0.19  0.20  0.21  0.19  0.26  0.15  0.20  0.18  0.17  0.43  0.45 
## rotate.8  0.21  0.16  0.18  0.16  0.13  0.14  0.15  0.22  0.16  0.15  0.17  0.19  0.43  0.44 
##          rtt.6 rtt.8
## rotate.6 1.00       
## rotate.8 0.42  1.00
corPlot(ability)

fa.parallel(ability)

## Parallel analysis suggests that the number of factors =  4  and the number of components =  2
f1.ab <- fa(ability) 
f1.ab
## Factor Analysis using method =  minres
## Call: fa(r = ability)
## Standardized loadings (pattern matrix) based upon correlation matrix
##            MR1   h2   u2 com
## reason.4  0.55 0.30 0.70   1
## reason.16 0.45 0.20 0.80   1
## reason.17 0.54 0.29 0.71   1
## reason.19 0.47 0.22 0.78   1
## letter.7  0.52 0.27 0.73   1
## letter.33 0.48 0.23 0.77   1
## letter.34 0.54 0.29 0.71   1
## letter.58 0.53 0.28 0.72   1
## matrix.45 0.41 0.17 0.83   1
## matrix.46 0.43 0.18 0.82   1
## matrix.47 0.47 0.22 0.78   1
## matrix.55 0.35 0.12 0.88   1
## rotate.3  0.50 0.25 0.75   1
## rotate.4  0.55 0.30 0.70   1
## rotate.6  0.53 0.28 0.72   1
## rotate.8  0.46 0.21 0.79   1
## 
##                 MR1
## SS loadings    3.81
## Proportion Var 0.24
## 
## Mean item complexity =  1
## Test of the hypothesis that 1 factor is sufficient.
## 
## The degrees of freedom for the null model are  120  and the objective function was  3.28 with Chi Square of  4973.83
## The degrees of freedom for the model are 104  and the objective function was  0.7 
## 
## The root mean square of the residuals (RMSR) is  0.07 
## The df corrected root mean square of the residuals is  0.07 
## 
## The harmonic number of observations is  1426 with the empirical chi square  1476.62  with prob <  3e-241 
## The total number of observations was  1525  with Likelihood Chi Square =  1063.25  with prob <  9.5e-159 
## 
## Tucker Lewis Index of factoring reliability =  0.772
## RMSEA index =  0.078  and the 90 % confidence intervals are  0.074 0.082
## BIC =  300.96
## Fit based upon off diagonal values = 0.93
## Measures of factor score adequacy             
##                                                    MR1
## Correlation of (regression) scores with factors   0.91
## Multiple R square of scores with factors          0.84
## Minimum correlation of possible factor scores     0.67
f2.ab <- fa(ability,2)
f2.ab
## Factor Analysis using method =  minres
## Call: fa(r = ability, nfactors = 2)
## Standardized loadings (pattern matrix) based upon correlation matrix
##             MR1   MR2   h2   u2 com
## reason.4   0.51  0.08 0.31 0.69 1.0
## reason.16  0.45  0.03 0.21 0.79 1.0
## reason.17  0.57  0.00 0.32 0.68 1.0
## reason.19  0.48  0.02 0.24 0.76 1.0
## letter.7   0.60 -0.05 0.33 0.67 1.0
## letter.33  0.52 -0.01 0.26 0.74 1.0
## letter.34  0.63 -0.07 0.35 0.65 1.0
## letter.58  0.45  0.12 0.28 0.72 1.2
## matrix.45  0.41  0.02 0.18 0.82 1.0
## matrix.46  0.45  0.01 0.20 0.80 1.0
## matrix.47  0.46  0.04 0.23 0.77 1.0
## matrix.55  0.24  0.15 0.12 0.88 1.7
## rotate.3  -0.03  0.72 0.49 0.51 1.0
## rotate.4   0.02  0.71 0.52 0.48 1.0
## rotate.6   0.09  0.59 0.40 0.60 1.0
## rotate.8  -0.03  0.65 0.40 0.60 1.0
## 
##                        MR1  MR2
## SS loadings           2.96 1.91
## Proportion Var        0.19 0.12
## Cumulative Var        0.19 0.30
## Proportion Explained  0.61 0.39
## Cumulative Proportion 0.61 1.00
## 
##  With factor correlations of 
##      MR1  MR2
## MR1 1.00 0.52
## MR2 0.52 1.00
## 
## Mean item complexity =  1.1
## Test of the hypothesis that 2 factors are sufficient.
## 
## The degrees of freedom for the null model are  120  and the objective function was  3.28 with Chi Square of  4973.83
## The degrees of freedom for the model are 89  and the objective function was  0.18 
## 
## The root mean square of the residuals (RMSR) is  0.03 
## The df corrected root mean square of the residuals is  0.03 
## 
## The harmonic number of observations is  1426 with the empirical chi square  288.87  with prob <  5.9e-23 
## The total number of observations was  1525  with Likelihood Chi Square =  277.64  with prob <  2.9e-21 
## 
## Tucker Lewis Index of factoring reliability =  0.948
## RMSEA index =  0.037  and the 90 % confidence intervals are  0.032 0.042
## BIC =  -374.71
## Fit based upon off diagonal values = 0.99
## Measures of factor score adequacy             
##                                                    MR1  MR2
## Correlation of (regression) scores with factors   0.90 0.89
## Multiple R square of scores with factors          0.81 0.79
## Minimum correlation of possible factor scores     0.63 0.58
fa.diagram(f2.ab)