User Tools

Site Tools


factor_analysis

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
factor_analysis [2021/06/15 12:14] – [Interpretation of factor loading and the rotation method] hkimscilfactor_analysis [2023/11/06 02:53] (current) – [E.g. 2] hkimscil
Line 185: Line 185:
 | Y3  | $S_{31}$  | $S_{32}$  | $S^2_{3}$  | | Y3  | $S_{31}$  | $S_{32}$  | $S^2_{3}$  |
  
-실제 데이터에서 구한 variance covariance table은 아래와 같다. +실제 데이터에서 구한 variance covariance table은 아래와 같다((편의상 여기 분산값은 n으로 (n-1이 아닌) 나눠 준 것))
  
 | Variable  | Y1  | Y2  | Y3  | | Variable  | Y1  | Y2  | Y3  |
Line 197: Line 197:
 ## 예를 들어  ## 예를 들어 
 fd <- read.csv("http://commres.net/wiki/_media/r/fa_explanation.csv") fd <- read.csv("http://commres.net/wiki/_media/r/fa_explanation.csv")
 +fd <- fd[, -1] # 처음 id 컬럼 지우기
 cov(fd) cov(fd)
  
Line 222: Line 223:
 ====== Interpretation of factor loading and the rotation method ====== ====== Interpretation of factor loading and the rotation method ======
  
-위의 분석작업을 통해서 아래와 같은 regression 공식을 얻었다고 가정하자. 아래 공식의 문제점은 F1과 F2의 loading값이 골고루 퍼져 있어서, finance 점수에 영향을 주는 것이 F1인지 F2인지 이야기하기기 어렵다는 점이다. 즉, factor loadings are not unique하다는 것이다. +위의 분석작업을 통해서 아래와 같은 regression 공식을 얻었다고 가정하자 (Linear Algera를 대학교육에서 가르치는 이유를 여기서도 알게된다. 그리고 거기서 배우는 Eigen vector, Eigen value 등이 지금 여기서와 무슨관계인지도. . . 그러나, 수학을 잘 모르는 학생들을 위한 설명이기에 이를 이용하지 않고 설명한다). 아래 공식의 문제점은 F1과 F2의 loading값이 골고루 퍼져 있어서, finance 점수에 영향을 주는 것이 F1인지 F2인지 이야기하기기 어렵다는 점이다. 즉, factor loadings are not unique하다는 것이다. 
  
 좀 더 설명하자면 우리가 regression에서 배운 것에 의하면 아래는 $Y_{1}$ 은 F1이 0.5만큼 F2가 0.5만큼 설명한다고 하겠다. 이것을 팩터로딩이 팩터 간에 독립적으로 나타나지 않는다고 이야기 한다는 뜻이다. 그러나 우리가 factor analysis 를 하는 이유는 Factor 중의 하나가 $Y_{1}$에 온전히 기여를 하고 나머지는 기여를 하지 않는 구조를 가지는가를 보기 위해서다. 이를 위해서 아래의 해는 로테이션이라는 과정을 한번 더 거치게 된다 (바로 아래 문장 참조 - "한편 아래의 공식에서 . . ."  ). 좀 더 설명하자면 우리가 regression에서 배운 것에 의하면 아래는 $Y_{1}$ 은 F1이 0.5만큼 F2가 0.5만큼 설명한다고 하겠다. 이것을 팩터로딩이 팩터 간에 독립적으로 나타나지 않는다고 이야기 한다는 뜻이다. 그러나 우리가 factor analysis 를 하는 이유는 Factor 중의 하나가 $Y_{1}$에 온전히 기여를 하고 나머지는 기여를 하지 않는 구조를 가지는가를 보기 위해서다. 이를 위해서 아래의 해는 로테이션이라는 과정을 한번 더 거치게 된다 (바로 아래 문장 참조 - "한편 아래의 공식에서 . . ."  ).
Line 332: Line 333:
 각주 1) -> finance = 수학능력 = F1 각주 1) -> finance = 수학능력 = F1
 각주 2), 3) -> marketing, policy = 언어능력 = F2 각주 2), 3) -> marketing, policy = 언어능력 = F2
-각주 4)는  아래와 같이 구함 = Eigenvalue라 부른다+각주 6)는  아래와 같이 구함 = Eigenvalue라 부른다
  
 <code> <code>
Line 457: Line 458:
 | Economics        @lightgreen:0.728  | | Economics        @lightgreen:0.728  |
 | Total            5.617  | | Total            5.617  |
 +===== Specificity =====
 +| Variable  |  Communality  |  Specificity  |
 +| Climate          0.795  |  @lightgray:1-0.795  |
 +| Housing          0.518  |     |
 +| Health          |  0.722  |     |
 +| Crime            0.512  |     |
 +| Transportation  |  0.51       |
 +| Education        0.561  |     |
 +| Arts            |  0.754  |     |
 +| Recreation      |  0.517  |     |
 +| Economics        0.728  |     |
 +| Total            5.617  |     |
  
 ====== Methods (functions) in R ====== ====== Methods (functions) in R ======
Line 468: Line 481:
  
 <code> <code>
-mydata <- read.csv("http://commres.net/wiki/_media/r/dataset_exploratoryfactoranalysis.csv")+my.data <- read.csv("http://commres.net/wiki/_media/r/dataset_exploratoryfactoranalysis.csv")
 # if data as NAs, it is better to omit them: # if data as NAs, it is better to omit them:
 my.data <- na.omit(my.data) my.data <- na.omit(my.data)
Line 1111: Line 1124:
 Cumulative Proportion 0.25 0.43 0.60 0.75 0.88 1.00 Cumulative Proportion 0.25 0.43 0.60 0.75 0.88 1.00
  
-SS total = 32.14286 
 SS loadings = eigenvalues for each factor (MR1, . . . ) SS loadings = eigenvalues for each factor (MR1, . . . )
 </code> </code>
 +
 SS loadings           <fc #ff0000>4.50</fc>  SS loadings           <fc #ff0000>4.50</fc> 
-SS total              <fc #ff0000>32.14286</fc> (성격변인 들의 SS값을 모두 더한 값 즉, 각 변인의 SS값을 구하여 이를 더한 값) +<code> 
-$\frac {4.5}{32.14286} = 0.14$+# SS total = 각 변인들의 분산을 (variation) 1 로 보았을 때 SS loading 값을 구한 것이므로  
 +# SS total 값은 각 변인들의 숫자만큼이 된다. 이 경우는 총 32개 문항이 존재하므로 32가 SS total 
 +ss.tot = 32 
 +</code> 
 + 
 +SS total              <fc #ff0000>32</fc> (성격변인 들의 SS값을 모두 더한 값 즉, 각 변인의 SS값을 구하여 이를 더한 값) 
 +$\frac {4.5}{32} = 0.14$
 Proportion Var        <fc #ff0000>0.14</fc>  Proportion Var        <fc #ff0000>0.14</fc> 
 eigenvalues for factor 1  eigenvalues for factor 1 
  
 | SS loadings \\ eigenvalue  | 4.50  | 3.19  | 2.97  | 2.55  | 2.31  | 2.16  | | SS loadings \\ eigenvalue  | 4.50  | 3.19  | 2.97  | 2.55  | 2.31  | 2.16  |
-|                            | $\frac {4.5}{32.14286}$  | $\frac {3.19}{32.14286}$  | $\frac {2.97}{32.14286}$  | $\frac {2.55}{32.14286}$  | $\frac {2.31}{32.14286}$  | $\frac {2.16}{32.14286}$  |+|                            | $\frac {4.5}{32}$  | $\frac {3.19}{32}$  | $\frac {2.97}{32}$  | $\frac {2.55}{32}$  | $\frac {2.31}{32}$  | $\frac {2.16}{32}$  |
 | Proportion Var          | 0.14  | 0.10  | 0.09  | 0.08  | 0.07  | 0.07  | | Proportion Var          | 0.14  | 0.10  | 0.09  | 0.08  | 0.07  | 0.07  |
 | Cumulative Var          | 0.14  | 0.24  | 0.33  | 0.41  | 0.48  | 0.55  |  | Cumulative Var          | 0.14  | 0.24  | 0.33  | 0.41  | 0.48  | 0.55  | 
Line 1133: Line 1152:
 [1] 4.500258 [1] 4.500258
 </code> </code>
- 
-What is the total variance of all variables? 
-\begin{eqnarray*} 
-4.5 : 0.14 =& x : 1.00 \\  
-x =& 4.5 / .14 \\ 
-  =& 32.14286 
-\end{eqnarray*} 
  
 <code> <code>
-> (4.50+3.19+2.97+2.55+2.31+2.16)/32.14286 +> (4.50+3.19+2.97+2.55+2.31+2.16)/32 
-[1] 0.5500444+[1] 0.5525 
 + 
 +> or  
 +sum(d.fa.so.loadings^2)/ss.tot
 </code> </code>
 ===== specific variance ===== ===== specific variance =====
Line 1549: Line 1564:
 ====== Reference ====== ====== Reference ======
 {{:factor_analysis_lecture_note.pdf|Lecture Note}} from databaser {{:factor_analysis_lecture_note.pdf|Lecture Note}} from databaser
 +[[https://stats.oarc.ucla.edu/spss/seminars/introduction-to-factor-analysis/a-practical-introduction-to-factor-analysis/]] 
 +[[https://advstats.psychstat.org/book/factor/efa.php]] 
 +see exploratory factor analysis :: {{youtube>Ollp2nSQCLY}}
factor_analysis.txt · Last modified: 2023/11/06 02:53 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki