R version 4.1.0 (2021-05-18) -- "Camp Pontanezen" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) R は、自由なソフトウェアであり、「完全に無保証」です。 一定の条件に従えば、自由にこれを再配布することができます。 配布条件の詳細に関しては、'license()' あるいは 'licence()' と入力してください。 R は多くの貢献者による共同プロジェクトです。 詳しくは 'contributors()' と入力してください。 また、R や R のパッケージを出版物で引用する際の形式については 'citation()' と入力してください。 'demo()' と入力すればデモをみることができます。 'help()' とすればオンラインヘルプが出ます。 'help.start()' で HTML ブラウザによるヘルプがみられます。 'q()' と入力すれば R を終了します。 > library(psych) > library(GPArotation) > five.data <- read.csv("g:/r/five_subject.csv") > head(five.data) 国語 社会 英語 数学 理科 1 3 3 4 5 5 2 4 3 4 4 4 3 5 3 5 5 5 4 4 1 4 5 5 5 4 3 4 4 5 6 3 1 4 5 5 > print(cor(five.data),digits=3) 国語 社会 英語 数学 理科 国語 1.000 0.327 0.452 0.352 0.285 社会 0.327 1.000 0.304 0.137 0.157 英語 0.452 0.304 1.000 0.436 0.364 数学 0.352 0.137 0.436 1.000 0.499 理科 0.285 0.157 0.364 0.499 1.000 > five.result <- fa(five.data, nfactors=2, rotate="varimax") > print(five.result, digits=3) Factor Analysis using method = minres Call: fa(r = five.data, nfactors = 2, rotate = "varimax") Standardized loadings (pattern matrix) based upon correlation matrix MR1 MR2 h2 u2 com 国語 0.294 0.598 0.445 0.555 1.46 社会 0.065 0.512 0.267 0.733 1.03 英語 0.422 0.546 0.475 0.525 1.88 数学 0.827 0.169 0.712 0.288 1.08 理科 0.557 0.223 0.360 0.640 1.31 MR1 MR2 SS loadings 1.263 0.997 Proportion Var 0.253 0.199 Cumulative Var 0.253 0.452 Proportion Explained 0.559 0.441 Cumulative Proportion 0.559 1.000 Mean item complexity = 1.4 Test of the hypothesis that 2 factors are sufficient. The degrees of freedom for the null model are 10 and the objective function was 0.956 with Chi Square of 247.981 The degrees of freedom for the model are 1 and the objective function was 0.001 The root mean square of the residuals (RMSR) is 0.006 The df corrected root mean square of the residuals is 0.019 The harmonic number of observations is 263 with the empirical chi square 0.19 with prob < 0.663 The total number of observations was 263 with Likelihood Chi Square = 0.313 with prob < 0.576 Tucker Lewis Index of factoring reliability = 1.029 RMSEA index = 0 and the 90 % confidence intervals are 0 0.1344 BIC = -5.259 Fit based upon off diagonal values = 1 Measures of factor score adequacy MR1 MR2 Correlation of (regression) scores with factors 0.848 0.745 Multiple R square of scores with factors 0.720 0.554 Minimum correlation of possible factor scores 0.439 0.109 > > fa.diagram(five.result, cut=0, simple=FALSE, sort=FALSE, digits=3) > fa.diagram(five.result) > five.result <- fa(five.data, nfactors=3, rotate="varimax") > print(five.result, digits=3) Factor Analysis using method = minres Call: fa(r = five.data, nfactors = 3, rotate = "varimax") Standardized loadings (pattern matrix) based upon correlation matrix MR1 MR2 MR3 h2 u2 com 国語 0.285 0.564 0.231 0.453 0.547 1.85 社会 0.075 0.557 -0.038 0.317 0.683 1.05 英語 0.421 0.503 0.209 0.474 0.526 2.31 数学 0.726 0.163 0.229 0.607 0.393 1.31 理科 0.658 0.190 -0.044 0.471 0.529 1.18 MR1 MR2 MR3 SS loadings 1.224 0.944 0.153 Proportion Var 0.245 0.189 0.031 Cumulative Var 0.245 0.434 0.464 Proportion Explained 0.527 0.407 0.066 Cumulative Proportion 0.527 0.934 1.000 Mean item complexity = 1.5 Test of the hypothesis that 3 factors are sufficient. The degrees of freedom for the null model are 10 and the objective function was 0.956 with Chi Square of 247.981 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 NA The harmonic number of observations is 263 with the empirical chi square 0 with prob < NA The total number of observations was 263 with Likelihood Chi Square = 0 with prob < NA Tucker Lewis Index of factoring reliability = 1.0424 Fit based upon off diagonal values = 1 Measures of factor score adequacy MR1 MR2 MR3 Correlation of (regression) scores with factors 0.808 0.730 0.385 Multiple R square of scores with factors 0.653 0.533 0.148 Minimum correlation of possible factor scores 0.306 0.065 -0.704 > fa(five.data, nfactors=3, rotate="promax") Factor Analysis using method = minres Call: fa(r = five.data, nfactors = 3, rotate = "promax") Standardized loadings (pattern matrix) based upon correlation matrix MR1 MR2 MR3 h2 u2 com 国語 0.01 0.39 0.38 0.45 0.55 2.0 社会 -0.03 0.57 0.02 0.32 0.68 1.0 英語 0.19 0.31 0.34 0.47 0.53 2.6 数学 0.59 -0.12 0.32 0.61 0.39 1.7 理科 0.69 0.06 -0.04 0.47 0.53 1.0 MR1 MR2 MR3 SS loadings 1.00 0.70 0.62 Proportion Var 0.20 0.14 0.12 Cumulative Var 0.20 0.34 0.46 Proportion Explained 0.43 0.30 0.27 Cumulative Proportion 0.43 0.73 1.00 With factor correlations of MR1 MR2 MR3 MR1 1.00 0.38 0.61 MR2 0.38 1.00 0.47 MR3 0.61 0.47 1.00 Mean item complexity = 1.6 Test of the hypothesis that 3 factors are sufficient. The degrees of freedom for the null model are 10 and the objective function was 0.96 with Chi Square of 247.98 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 NA The harmonic number of observations is 263 with the empirical chi square 0 with prob < NA The total number of observations was 263 with Likelihood Chi Square = 0 with prob < NA Tucker Lewis Index of factoring reliability = 1.042 Fit based upon off diagonal values = 1 Measures of factor score adequacy MR1 MR2 MR3 Correlation of (regression) scores with factors 0.84 0.75 0.78 Multiple R square of scores with factors 0.71 0.56 0.60 Minimum correlation of possible factor scores 0.41 0.12 0.20 > fa.diagram(five.result, cut=0, simply=FALSE, sort=FALSE, digits=3) 23 件の警告がありました (警告を見るには warnings() を使って下さい) > fa.diagram(five.result, cut=0, simple=FALSE, sort=FALSE, digits=3) > KMO(five.result) cor(r, use = "pairwise") でエラー: supply both 'x' and 'y' or a matrix-like 'x' > KMO(five.data) Kaiser-Meyer-Olkin factor adequacy Call: KMO(r = five.data) Overall MSA = 0.74 MSA for each item = 国語 社会 英語 数学 理科 0.76 0.74 0.76 0.71 0.73 > test.data <- read.csv("g:/r/KMOtest.csv") > KMO(test.data) Kaiser-Meyer-Olkin factor adequacy Call: KMO(r = test.data) 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 > five.result <- fa(five.data, nfactors=3, rotate="varimax", fm="ml") > print(five.result, digits=3) Factor Analysis using method = ml Call: fa(r = five.data, nfactors = 3, rotate = "varimax", fm = "ml") Standardized loadings (pattern matrix) based upon correlation matrix ML1 ML2 ML3 h2 u2 com 国語 0.282 0.587 0.180 0.456 0.544 1.65 社会 0.069 0.542 -0.058 0.302 0.698 1.06 英語 0.419 0.523 0.149 0.472 0.528 2.09 数学 0.741 0.180 0.209 0.625 0.375 1.28 理科 0.648 0.199 -0.080 0.465 0.535 1.22 ML1 ML2 ML3 SS loadings 1.228 0.983 0.108 Proportion Var 0.246 0.197 0.022 Cumulative Var 0.246 0.442 0.464 Proportion Explained 0.530 0.424 0.047 Cumulative Proportion 0.530 0.953 1.000 Mean item complexity = 1.5 Test of the hypothesis that 3 factors are sufficient. The degrees of freedom for the null model are 10 and the objective function was 0.956 with Chi Square of 247.981 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 NA The harmonic number of observations is 263 with the empirical chi square 0 with prob < NA The total number of observations was 263 with Likelihood Chi Square = 0 with prob < NA Tucker Lewis Index of factoring reliability = 1.0424 Fit based upon off diagonal values = 1 Measures of factor score adequacy ML1 ML2 ML3 Correlation of (regression) scores with factors 0.813 0.739 0.359 Multiple R square of scores with factors 0.661 0.546 0.129 Minimum correlation of possible factor scores 0.322 0.092 -0.742 > five.result <- fa(five.data, nfactors=2, rotate="varimax", fm="ml") > print(five.result, digits=3) Factor Analysis using method = ml Call: fa(r = five.data, nfactors = 2, rotate = "varimax", fm = "ml") Standardized loadings (pattern matrix) based upon correlation matrix ML1 ML2 h2 u2 com 国語 0.303 0.594 0.444 0.556 1.49 社会 0.064 0.515 0.270 0.730 1.03 英語 0.423 0.544 0.474 0.526 1.89 数学 0.822 0.167 0.703 0.297 1.08 理科 0.563 0.216 0.363 0.637 1.29 ML1 ML2 SS loadings 1.267 0.988 Proportion Var 0.253 0.198 Cumulative Var 0.253 0.451 Proportion Explained 0.562 0.438 Cumulative Proportion 0.562 1.000 Mean item complexity = 1.4 Test of the hypothesis that 2 factors are sufficient. The degrees of freedom for the null model are 10 and the objective function was 0.956 with Chi Square of 247.981 The degrees of freedom for the model are 1 and the objective function was 0.001 The root mean square of the residuals (RMSR) is 0.006 The df corrected root mean square of the residuals is 0.02 The harmonic number of observations is 263 with the empirical chi square 0.207 with prob < 0.649 The total number of observations was 263 with Likelihood Chi Square = 0.298 with prob < 0.585 Tucker Lewis Index of factoring reliability = 1.0297 RMSEA index = 0 and the 90 % confidence intervals are 0 0.1333 BIC = -5.274 Fit based upon off diagonal values = 1 Measures of factor score adequacy ML1 ML2 Correlation of (regression) scores with factors 0.845 0.743 Multiple R square of scores with factors 0.714 0.551 Minimum correlation of possible factor scores 0.429 0.103 > five.result <- fa(five.data, nfactors=2, rotate="varimax", fm="uls") > print(five.result, digits=3) Factor Analysis using method = uls Call: fa(r = five.data, nfactors = 2, rotate = "varimax", fm = "uls") Standardized loadings (pattern matrix) based upon correlation matrix ULS1 ULS2 h2 u2 com 国語 0.294 0.598 0.445 0.555 1.46 社会 0.065 0.512 0.267 0.733 1.03 英語 0.422 0.546 0.475 0.525 1.88 数学 0.827 0.169 0.712 0.288 1.08 理科 0.557 0.223 0.360 0.640 1.31 ULS1 ULS2 SS loadings 1.263 0.997 Proportion Var 0.253 0.199 Cumulative Var 0.253 0.452 Proportion Explained 0.559 0.441 Cumulative Proportion 0.559 1.000 Mean item complexity = 1.4 Test of the hypothesis that 2 factors are sufficient. The degrees of freedom for the null model are 10 and the objective function was 0.956 with Chi Square of 247.981 The degrees of freedom for the model are 1 and the objective function was 0.001 The root mean square of the residuals (RMSR) is 0.006 The df corrected root mean square of the residuals is 0.019 The harmonic number of observations is 263 with the empirical chi square 0.19 with prob < 0.663 The total number of observations was 263 with Likelihood Chi Square = 0.313 with prob < 0.576 Tucker Lewis Index of factoring reliability = 1.029 RMSEA index = 0 and the 90 % confidence intervals are 0 0.1344 BIC = -5.259 Fit based upon off diagonal values = 1 Measures of factor score adequacy ULS1 ULS2 Correlation of (regression) scores with factors 0.848 0.745 Multiple R square of scores with factors 0.720 0.554 Minimum correlation of possible factor scores 0.439 0.109 > five.result <- fa(five.data, nfactors=2, rotate="varimax", fm="gls") > print(five.result, digits=3) Factor Analysis using method = gls Call: fa(r = five.data, nfactors = 2, rotate = "varimax", fm = "gls") Standardized loadings (pattern matrix) based upon correlation matrix GLS1 GLS2 h2 u2 com 国語 0.296 0.597 0.444 0.556 1.46 社会 0.064 0.515 0.269 0.731 1.03 英語 0.424 0.543 0.475 0.525 1.89 数学 0.821 0.170 0.703 0.297 1.09 理科 0.561 0.220 0.363 0.637 1.30 GLS1 GLS2 SS loadings 1.261 0.994 Proportion Var 0.252 0.199 Cumulative Var 0.252 0.451 Proportion Explained 0.559 0.441 Cumulative Proportion 0.559 1.000 Mean item complexity = 1.4 Test of the hypothesis that 2 factors are sufficient. The degrees of freedom for the null model are 10 and the objective function was 0.956 with Chi Square of 247.981 The degrees of freedom for the model are 1 and the objective function was 0.001 The root mean square of the residuals (RMSR) is 0.006 The df corrected root mean square of the residuals is 0.019 The harmonic number of observations is 263 with the empirical chi square 0.192 with prob < 0.661 The total number of observations was 263 with Likelihood Chi Square = 0.309 with prob < 0.578 Tucker Lewis Index of factoring reliability = 1.0292 RMSEA index = 0 and the 90 % confidence intervals are 0 0.1341 BIC = -5.263 Fit based upon off diagonal values = 1 Measures of factor score adequacy GLS1 GLS2 Correlation of (regression) scores with factors 0.845 0.743 Multiple R square of scores with factors 0.713 0.553 Minimum correlation of possible factor scores 0.427 0.106 > five.result <- fa(five.data, nfactors=2, rotate="varimax", fm="pa") > print(five.result, digits=3) Factor Analysis using method = pa Call: fa(r = five.data, nfactors = 2, rotate = "varimax", fm = "pa") Standardized loadings (pattern matrix) based upon correlation matrix PA1 PA2 h2 u2 com 国語 0.300 0.595 0.444 0.556 1.48 社会 0.067 0.515 0.269 0.731 1.03 英語 0.430 0.539 0.476 0.524 1.90 数学 0.806 0.172 0.680 0.320 1.09 理科 0.572 0.211 0.372 0.628 1.27 PA1 PA2 SS loadings 1.256 0.984 Proportion Var 0.251 0.197 Cumulative Var 0.251 0.448 Proportion Explained 0.561 0.439 Cumulative Proportion 0.561 1.000 Mean item complexity = 1.4 Test of the hypothesis that 2 factors are sufficient. The degrees of freedom for the null model are 10 and the objective function was 0.956 with Chi Square of 247.981 The degrees of freedom for the model are 1 and the objective function was 0.001 The root mean square of the residuals (RMSR) is 0.006 The df corrected root mean square of the residuals is 0.02 The harmonic number of observations is 263 with the empirical chi square 0.207 with prob < 0.649 The total number of observations was 263 with Likelihood Chi Square = 0.322 with prob < 0.57 Tucker Lewis Index of factoring reliability = 1.0286 RMSEA index = 0 and the 90 % confidence intervals are 0 0.1349 BIC = -5.25 Fit based upon off diagonal values = 1 Measures of factor score adequacy PA1 PA2 Correlation of (regression) scores with factors 0.835 0.740 Multiple R square of scores with factors 0.697 0.548 Minimum correlation of possible factor scores 0.395 0.096 > > set.data <- read.csv("g:/r/set_data.csv") > head(set.data) q1 q2 q3 q4 q5 q6 q7 q8 q9 1 3 4 3 3 4 4 5 5 5 2 4 4 3 4 4 3 4 4 4 3 4 5 3 5 5 5 5 5 5 4 3 4 1 4 3 5 2 5 2 5 4 4 3 4 4 4 4 5 5 6 3 4 1 3 3 3 3 5 3 > fa.parallel(set.data) Parallel analysis suggests that the number of factors = 3 and the number of components = 1 警告メッセージ: 1: fa.stats(r = r, f = f, phi = phi, n.obs = n.obs, np.obs = np.obs, で: The estimated weights for the factor scores are probably incorrect. Try a different factor score estimation method. 2: fac(r = r, nfactors = nfactors, n.obs = n.obs, rotate = rotate, で: An ultra-Heywood case was detected. Examine the results carefully > 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 -48.62 with 3 factors Sample Size adjusted BIC achieves a minimum of -11.03 with 4 factors Statistics by number of factors vss1 vss2 map dof chisq prob sqresid fit RMSEA BIC 1 0.82 0.00 0.044 27 1.8e+02 2.6e-24 3.9 0.82 0.148 28.8 2 0.59 0.85 0.063 19 6.5e+01 6.4e-07 3.1 0.85 0.097 -40.6 3 0.48 0.76 0.072 12 1.8e+01 1.2e-01 2.6 0.88 0.044 -48.6 4 0.54 0.77 0.118 6 3.2e+00 7.8e-01 1.8 0.92 0.000 -30.1 5 0.52 0.69 0.227 1 3.3e-02 8.6e-01 1.3 0.94 0.000 -5.5 6 0.47 0.70 0.304 -3 2.7e-07 NA 1.7 0.92 NA NA 7 0.46 0.66 0.525 -6 4.2e-08 NA 1.7 0.92 NA NA 8 0.46 0.66 1.000 -8 3.3e-11 NA 1.6 0.92 NA NA SABIC complex eChisq SRMR eCRMS eBIC 1 114.4 1.0 1.0e+02 7.4e-02 0.0858 -47.7 2 19.7 1.5 4.0e+01 4.6e-02 0.0640 -65.5 3 -10.6 1.7 1.3e+01 2.6e-02 0.0457 -53.7 4 -11.0 1.8 1.4e+00 8.7e-03 0.0213 -31.9 5 -2.3 1.9 6.3e-03 5.8e-04 0.0035 -5.5 6 NA 2.0 5.4e-08 1.7e-06 NA NA 7 NA 2.1 1.0e-08 7.4e-07 NA NA 8 NA 2.1 6.5e-12 1.9e-08 NA NA > five.result <- fa(set.data, nfactors=6, rotate="varimax")$loadings > print(five.result, digits=3) Loadings: MR1 MR2 MR4 MR3 MR6 MR5 q1 0.253 0.756 0.200 0.152 0.301 q2 0.261 0.372 0.104 0.474 0.338 q3 0.155 0.652 0.143 q4 0.929 0.237 0.183 0.126 -0.119 q5 0.561 0.334 0.282 0.324 q6 0.770 0.184 0.276 0.237 q7 0.260 0.523 0.213 0.141 -0.129 q8 0.155 0.224 0.580 q9 0.157 0.211 0.556 0.151 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 > print(five.result, digits=3, cutoff=0.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 > five.result <- fa(set.data, nfactors=3, rotate="varimax")$loadings > print(five.result, digits=3, cutoff=0.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 > 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 > > fa.plot(fa.result) > 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 > fa.plot(fa.result) > fa.result <- fa(set.data, nfactors=2, rotate="quartimin") > print(fa.result, digits=3) 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 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.950 0.923 Multiple R square of scores with factors 0.902 0.851 Minimum correlation of possible factor scores 0.803 0.702 > > print(fa.result, digits=3) 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 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.950 0.923 Multiple R square of scores with factors 0.902 0.851 Minimum correlation of possible factor scores 0.803 0.702 > print(fa.result$Structure, digits=3, cutoff=0) Loadings: MR1 MR2 q1 0.531 0.895 q2 0.526 0.584 q3 0.354 0.595 q4 0.867 0.522 q5 0.767 0.582 q6 0.895 0.485 q7 0.507 0.377 q8 0.412 0.315 q9 0.428 0.388 MR1 MR2 SS loadings 3.434 2.734 Proportion Var 0.382 0.304 Cumulative Var 0.382 0.685 > fa.result <- fa(set.data, nfactors=3, rotate="varimax") > print(fa.result, digits=3) Factor Analysis using method = minres Call: fa(r = set.data, nfactors = 3, rotate = "varimax") Standardized loadings (pattern matrix) based upon correlation matrix MR1 MR2 MR3 h2 u2 com q1 0.209 0.949 0.206 0.986 0.0141 1.19 q2 0.248 0.411 0.406 0.395 0.6048 2.63 q3 0.170 0.512 0.170 0.320 0.6803 1.45 q4 0.925 0.262 0.235 0.980 0.0202 1.30 q5 0.534 0.328 0.455 0.599 0.4009 2.65 q6 0.741 0.223 0.394 0.754 0.2463 1.73 q7 0.260 0.159 0.487 0.330 0.6700 1.77 q8 0.135 0.100 0.537 0.317 0.6832 1.20 q9 0.172 0.209 0.442 0.269 0.7311 1.76 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 Proportion Explained 0.392 0.330 0.278 Cumulative Proportion 0.392 0.722 1.000 Mean item complexity = 1.7 Test of the hypothesis that 3 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 12 and the objective function was 0.072 The root mean square of the residuals (RMSR) is 0.026 The df corrected root mean square of the residuals is 0.046 The harmonic number of observations is 257 with the empirical chi square 12.901 with prob < 0.376 The total number of observations was 257 with Likelihood Chi Square = 17.967 with prob < 0.117 Tucker Lewis Index of factoring reliability = 0.9803 RMSEA index = 0.0438 and the 90 % confidence intervals are 0 0.0836 BIC = -48.622 Fit based upon off diagonal values = 0.996 Measures of factor score adequacy MR1 MR2 MR3 Correlation of (regression) scores with factors 0.976 0.985 0.757 Multiple R square of scores with factors 0.953 0.971 0.573 Minimum correlation of possible factor scores 0.905 0.942 0.146 > fa.result <- fa(set.data, nfactors=3, rotate="promax", pro.m=2) > print(fa.result, digits=3) Factor Analysis using method = minres Call: fa(r = set.data, nfactors = 3, rotate = "promax", pro.m = 2) Standardized loadings (pattern matrix) based upon correlation matrix MR1 MR2 MR3 h2 u2 com q1 0.026 0.976 0.013 0.986 0.0141 1.00 q2 0.118 0.335 0.329 0.395 0.6048 2.24 q3 0.065 0.505 0.061 0.320 0.6803 1.06 q4 0.954 0.076 0.005 0.980 0.0202 1.01 q5 0.446 0.181 0.334 0.599 0.4009 2.22 q6 0.715 0.037 0.235 0.754 0.2463 1.22 q7 0.156 0.039 0.465 0.330 0.6700 1.24 q8 0.013 -0.013 0.562 0.317 0.6832 1.00 q9 0.058 0.118 0.426 0.269 0.7311 1.19 MR1 MR2 MR3 SS loadings 2.006 1.614 1.329 Proportion Var 0.223 0.179 0.148 Cumulative Var 0.223 0.402 0.550 Proportion Explained 0.405 0.326 0.269 Cumulative Proportion 0.405 0.731 1.000 With factor correlations of MR1 MR2 MR3 MR1 1.000 0.411 0.467 MR2 0.411 1.000 0.413 MR3 0.467 0.413 1.000 Mean item complexity = 1.4 Test of the hypothesis that 3 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 12 and the objective function was 0.072 The root mean square of the residuals (RMSR) is 0.026 The df corrected root mean square of the residuals is 0.046 The harmonic number of observations is 257 with the empirical chi square 12.901 with prob < 0.376 The total number of observations was 257 with Likelihood Chi Square = 17.967 with prob < 0.117 Tucker Lewis Index of factoring reliability = 0.9803 RMSEA index = 0.0438 and the 90 % confidence intervals are 0 0.0836 BIC = -48.622 Fit based upon off diagonal values = 0.996 Measures of factor score adequacy MR1 MR2 MR3 Correlation of (regression) scores with factors 0.99 0.994 0.822 Multiple R square of scores with factors 0.98 0.987 0.676 Minimum correlation of possible factor scores 0.96 0.974 0.351 > fa.plot(fa.result) > > head(five.data) 国語 社会 英語 数学 理科 1 3 3 4 5 5 2 4 3 4 4 4 3 5 3 5 5 5 4 4 1 4 5 5 5 4 3 4 4 5 6 3 1 4 5 5 > head(scale(five.data)) 国語 社会 英語 数学 理科 [1,] -1.2409697 0.1665481 -0.01741029 0.9374445 0.6698173 [2,] -0.1116443 0.1665481 -0.01741029 -0.4959736 -1.0079156 [3,] 1.0176810 0.1665481 1.12731614 0.9374445 0.6698173 [4,] -0.1116443 -1.6212947 -0.01741029 0.9374445 0.6698173 [5,] -0.1116443 0.1665481 -0.01741029 -0.4959736 0.6698173 [6,] -1.2409697 -1.6212947 -0.01741029 0.9374445 0.6698173 > five.result <- fa(five.data, nfactors=2, rotate="varimax") > print(five.result,digits=3) Factor Analysis using method = minres Call: fa(r = five.data, nfactors = 2, rotate = "varimax") Standardized loadings (pattern matrix) based upon correlation matrix MR1 MR2 h2 u2 com 国語 0.294 0.598 0.445 0.555 1.46 社会 0.065 0.512 0.267 0.733 1.03 英語 0.422 0.546 0.475 0.525 1.88 数学 0.827 0.169 0.712 0.288 1.08 理科 0.557 0.223 0.360 0.640 1.31 MR1 MR2 SS loadings 1.263 0.997 Proportion Var 0.253 0.199 Cumulative Var 0.253 0.452 Proportion Explained 0.559 0.441 Cumulative Proportion 0.559 1.000 Mean item complexity = 1.4 Test of the hypothesis that 2 factors are sufficient. The degrees of freedom for the null model are 10 and the objective function was 0.956 with Chi Square of 247.981 The degrees of freedom for the model are 1 and the objective function was 0.001 The root mean square of the residuals (RMSR) is 0.006 The df corrected root mean square of the residuals is 0.019 The harmonic number of observations is 263 with the empirical chi square 0.19 with prob < 0.663 The total number of observations was 263 with Likelihood Chi Square = 0.313 with prob < 0.576 Tucker Lewis Index of factoring reliability = 1.029 RMSEA index = 0 and the 90 % confidence intervals are 0 0.1344 BIC = -5.259 Fit based upon off diagonal values = 1 Measures of factor score adequacy MR1 MR2 Correlation of (regression) scores with factors 0.848 0.745 Multiple R square of scores with factors 0.720 0.554 Minimum correlation of possible factor scores 0.439 0.109 > > head(five.result$scores) MR1 MR2 [1,] 0.8110161 -0.6000709 [2,] -0.5607036 0.0602164 [3,] 0.8489924 0.6955967 [4,] 0.9299796 -0.6795608 [5,] -0.2404849 0.1011289 [6,] 0.9522590 -1.1324947 > utils:::menuInstallPkgs() --- このセッションで使うために、CRAN のミラーサイトを選んでください --- URL 'https://cran.ism.ac.jp/bin/windows/contrib/4.1/lavaan_0.6-9.zip' を試しています Content type 'application/zip' length 3059893 bytes (2.9 MB) downloaded 2.9 MB package ‘lavaan’ successfully unpacked and MD5 sums checked The downloaded binary packages are in C:\Users\matsu\AppData\Local\Temp\RtmpymEfaO\downloaded_packages > library(lavaan) This is lavaan 0.6-9 lavaan is FREE software! Please report any bugs. 次のパッケージを付け加えます: ‘lavaan’ 以下のオブジェクトは ‘package:psych’ からマスクされています: cor2cov 警告メッセージ: パッケージ ‘lavaan’ はバージョン 4.1.1 の R の下で造られました > search() [1] ".GlobalEnv" "package:lavaan" "package:GPArotation" [4] "package:psych" "package:stats" "package:graphics" [7] "package:grDevices" "package:utils" "package:datasets" [10] "package:methods" "Autoloads" "package:base" > ls() [1] "fa.result" "five.data" "five.result" "set.data" "test.data" >