#s 4-1
> cortest.bartlett(five.data, n=263)
R was not square, finding R from data
$chisq
[1] 247.9806

$p.value
[1] 1.442618e-47

$df
[1] 10

#s 4-2
> datafile <- read.csv("http://mlab.arrow.jp/r_factor/kmotest.csv") #Ђɂ͏ĂȂ
>  KMO(datafile) 
Kaiser-Meyer-Olkin factor adequacy
Call: KMO(r = datafile)
Overall MSA =  0.75
MSA for each item = 
  v1   v2   v3   v4   v5   v6   v7   v8   v9  v10 
0.81 0.69 0.82 0.78 0.65 0.78 0.79 0.67 0.80 0.47 

#s 4-3
> fa(data1, nfactors=3, fm="ml", rotate="promax") #data1͉ˋ̃t@CȂ̂Ŏss
Factor Analysis using method =  ml
Call: fa(r = data1, nfactors = 3, rotate = "promax", fm = "ml")

#s 4-4
> set.data <- read.csv("http://mlab.arrow.jp/r_factor/set_data.csv")
> cortest.bartlett(set.data, n=257)
R was not square, finding R from data
$chisq
[1] 951.7394

$p.value
[1] 2.062573e-176

$df
[1] 36
>  KMO(set.data)
Kaiser-Meyer-Olkin factor adequacy
Call: KMO(r = set.data)
Overall MSA =  0.84
MSA for each item = 
  q1   q2   q3   q4   q5   q6   q7   q8   q9 
0.83 0.87 0.82 0.78 0.92 0.80 0.92 0.85 0.88 
>  pairs.panels(set.data)

#s 4-5
> eigen.result <- fa.parallel(set.data, fm="ml")
Parallel analysis suggests that the number of factors =  3  and the number of components =  1 
> eigen.result$pc.values
[1] 4.1766560 1.0261862 0.8859122 0.8348285 0.6412555 0.5623923 0.3629904 0.3531334 0.1566455
> eigen.result$fa.values
[1]  3.674453895  0.425458809  0.215007552  0.044625036 -0.002145536 -0.050397496 -0.171665733 -0.230024745 -0.348227333
> mean(eigen.result$fa.values)
[1] 0.3952316

#s 4-6
> vss(set.data)

Very Simple Structure
Call: vss(x = set.data)
VSS complexity 1 achieves a maximimum of 0.82  with  1  factors
VSS complexity 2 achieves a maximimum of 0.85  with  2  factors

The Velicer MAP achieves a minimum of 0.04  with  1  factors 
BIC achieves a minimum of  NA  with  3  factors
Sample Size adjusted BIC achieves a minimum of  NA  with  4  factors

Statistics by number of factors 
  vss1 vss2   map dof   chisq    prob sqresid  fit RMSEA   BIC SABIC complex  eChisq    SRMR  eCRMS  eBIC
1 0.82 0.00 0.044  27 1.8e+02 2.6e-24     3.9 0.82 0.148  28.8 114.4     1.0 1.0e+02 7.4e-02 0.0858 -47.7
2 0.59 0.85 0.063  19 6.5e+01 6.4e-07     3.1 0.85 0.097 -40.6  19.7     1.5 4.0e+01 4.6e-02 0.0640 -65.5
3 0.48 0.76 0.072  12 1.8e+01 1.2e-01     2.6 0.88 0.044 -48.6 -10.6     1.7 1.3e+01 2.6e-02 0.0457 -53.7
4 0.54 0.77 0.118   6 3.2e+00 7.8e-01     1.8 0.92 0.000 -30.1 -11.0     1.8 1.4e+00 8.7e-03 0.0213 -31.9
5 0.52 0.69 0.227   1 3.3e-02 8.6e-01     1.3 0.94 0.000  -5.5  -2.3     1.9 6.3e-03 5.8e-04 0.0035  -5.5
6 0.47 0.70 0.304  -3 2.7e-07      NA     1.7 0.92    NA    NA    NA     2.0 5.4e-08 1.7e-06     NA    NA
7 0.46 0.66 0.525  -6 4.2e-08      NA     1.7 0.92    NA    NA    NA     2.1 1.0e-08 7.4e-07     NA    NA
8 0.46 0.66 1.000  -8 3.3e-11      NA     1.6 0.92    NA    NA    NA     2.1 6.5e-12 1.9e-08     NA    NA

#s 4-7
> fa.result <- fa(set.data, nfactors=6, rotate="varimax")$loadings
> print(fa.result, cutoff=0.3, digits=3)

Loadings:
   MR1    MR2    MR4    MR3    MR6    MR5   
q1         0.756                0.301       
q2         0.372         0.474  0.338       
q3         0.652                            
q4  0.929                                   
q5  0.561  0.334         0.324              
q6  0.770                                   
q7                0.523                     
q8                       0.580              
q9                0.556                     

                 MR1   MR2   MR4   MR3   MR6   MR5
SS loadings    2.043 1.397 0.893 0.835 0.245 0.054
Proportion Var 0.227 0.155 0.099 0.093 0.027 0.006
Cumulative Var 0.227 0.382 0.481 0.574 0.601 0.608

#s 4-8
> fa.result <- fa(set.data, nfactors=3, rotate="varimax")$loadings
> print(fa.result, cutoff=0.3, digits=3)

Loadings:
   MR1   MR2   MR3  
q1       0.949      
q2       0.411 0.406
q3       0.512      
q4 0.925            
q5 0.534 0.328 0.455
q6 0.741       0.394
q7             0.487
q8             0.537
q9             0.442

                 MR1   MR2   MR3
SS loadings    1.939 1.636 1.374
Proportion Var 0.215 0.182 0.153
Cumulative Var 0.215 0.397 0.550

#s 4-9
> fa.result <- fa(set.data, nfactors=2, rotate="none")
> print(fa.result, digits=3)
Factor Analysis using method =  minres
Call: fa(r = set.data, nfactors = 2, rotate = "none")
Standardized loadings (pattern matrix) based upon correlation matrix
     MR1    MR2    h2    u2  com
q1 0.733  0.513 0.801 0.199 1.79
q2 0.606  0.151 0.390 0.610 1.12
q3 0.489  0.340 0.354 0.646 1.78
q4 0.823 -0.271 0.751 0.249 1.21
q5 0.776 -0.098 0.612 0.388 1.03
q6 0.829 -0.344 0.805 0.195 1.33
q7 0.511 -0.074 0.266 0.734 1.04
q8 0.418 -0.049 0.177 0.823 1.03
q9 0.459  0.020 0.211 0.789 1.00

                        MR1   MR2
SS loadings           3.757 0.611
Proportion Var        0.417 0.068
Cumulative Var        0.417 0.485
Proportion Explained  0.860 0.140
Cumulative Proportion 0.860 1.000

Mean item complexity =  1.3
Test of the hypothesis that 2 factors are sufficient.

The degrees of freedom for the null model are  36  and the objective function was  3.774 with Chi Square of  951.739
The degrees of freedom for the model are 19  and the objective function was  0.259 

The root mean square of the residuals (RMSR) is  0.046 
The df corrected root mean square of the residuals is  0.064 

The harmonic number of observations is  257 with the empirical chi square  39.949  with prob <  0.00332 
The total number of observations was  257  with Likelihood Chi Square =  64.857  with prob <  6.44e-07 

Tucker Lewis Index of factoring reliability =  0.9046
RMSEA index =  0.0968  and the 90 % confidence intervals are  0.0718 0.1235
BIC =  -40.576
Fit based upon off diagonal values = 0.987
Measures of factor score adequacy             
                                                    MR1   MR2
Correlation of (regression) scores with factors   0.959 0.848
Multiple R square of scores with factors          0.920 0.719
Minimum correlation of possible factor scores     0.840 0.438

#s 4-10
> fa.result <- fa(set.data, nfactors=2, rotate="varimax")
> print(fa.result, digits=3)
Factor Analysis using method =  minres
Call: fa(r = set.data, nfactors = 2, rotate = "varimax")
Standardized loadings (pattern matrix) based upon correlation matrix
     MR1   MR2    h2    u2  com
q1 0.284 0.849 0.801 0.199 1.22
q2 0.397 0.482 0.390 0.610 1.93
q3 0.190 0.564 0.354 0.646 1.23
q4 0.823 0.272 0.751 0.249 1.22
q5 0.682 0.383 0.612 0.388 1.57
q6 0.871 0.217 0.805 0.195 1.12
q7 0.455 0.244 0.266 0.734 1.53
q8 0.365 0.209 0.177 0.823 1.59
q9 0.357 0.289 0.211 0.789 1.92

                        MR1   MR2
SS loadings           2.643 1.725
Proportion Var        0.294 0.192
Cumulative Var        0.294 0.485
Proportion Explained  0.605 0.395
Cumulative Proportion 0.605 1.000

Mean item complexity =  1.5
Test of the hypothesis that 2 factors are sufficient.

The degrees of freedom for the null model are  36  and the objective function was  3.774 with Chi Square of  951.739
The degrees of freedom for the model are 19  and the objective function was  0.259 

The root mean square of the residuals (RMSR) is  0.046 
The df corrected root mean square of the residuals is  0.064 

The harmonic number of observations is  257 with the empirical chi square  39.949  with prob <  0.00332 
The total number of observations was  257  with Likelihood Chi Square =  64.857  with prob <  6.44e-07 

Tucker Lewis Index of factoring reliability =  0.9046
RMSEA index =  0.0968  and the 90 % confidence intervals are  0.0718 0.1235
BIC =  -40.576
Fit based upon off diagonal values = 0.987
Measures of factor score adequacy             
                                                    MR1   MR2
Correlation of (regression) scores with factors   0.923 0.887
Multiple R square of scores with factors          0.852 0.787
Minimum correlation of possible factor scores     0.705 0.573

#s 4-11
> fa.result <- fa(set.data, nfactors=2, rotate="quartimin")
> print(fa.result, digits=3, cutoff=0)
Factor Analysis using method =  minres
Call: fa(r = set.data, nfactors = 2, rotate = "quartimin")
Standardized loadings (pattern matrix) based upon correlation matrix
      MR1    MR2    h2    u2  com
q1 -0.004  0.898 0.801 0.199 1.00
q2  0.276  0.419 0.390 0.610 1.73
q3 -0.001  0.596 0.354 0.646 1.00
q4  0.862  0.008 0.751 0.249 1.00
q5  0.651  0.194 0.612 0.388 1.18
q6  0.940 -0.075 0.805 0.195 1.01
q7  0.439  0.116 0.266 0.734 1.14
q8  0.347  0.108 0.177 0.823 1.19
q9  0.305  0.206 0.211 0.789 1.76

                        MR1   MR2
SS loadings           2.727 1.641
Proportion Var        0.303 0.182
Cumulative Var        0.303 0.485
Proportion Explained  0.624 0.376
Cumulative Proportion 0.624 1.000

 With factor correlations of 
      MR1   MR2
MR1 1.000 0.596
MR2 0.596 1.000

Mean item complexity =  1.2
Test of the hypothesis that 2 factors are sufficient.

The degrees of freedom for the null model are  36  and the objective function was  3.774 0 with Chi Square of  951.739
The degrees of freedom for the model are 19  and the objective function was  0.259 
 0
The root mean square of the residuals (RMSR) is  0.046 
The df corrected root mean square of the residuals is  0.064 
 0
The harmonic number of observations is  257 with the empirical chi square  39.949  with prob <  0.00332 
 0The total number of observations was  257  with Likelihood Chi Square =  64.857  with prob <  6.44e-07 
 0
Tucker Lewis Index of factoring reliability =  0.9046
RMSEA index =  0.0968  and the 90 % confidence intervals are  0.0718 0.1235 0
BIC =  -40.576
Fit based upon off diagonal values = 0.987
Measures of factor score adequacy             
                                                    MR1   MR2
Correlation of (regression) scores with factors   0.950 0.923
Multiple R square of scores with factors          0.902 0.851
Minimum correlation of possible factor scores     0.803 0.702
