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 revisionBoth sides next revision
factor_analysis [2018/12/05 12:27] – [Factor solution among many . . .] hkimscilfactor_analysis [2018/12/05 13:13] – [Factor solution among many . . .] hkimscil
Line 298: Line 298:
 > </code> > </code>
  
 +
 +
 +<code>> fd <- data.frame(finance,marketing,policy)
 +> fd
 +  finance marketing policy
 +1                    5
 +2                    3
 +3      10              8
 +4                    7
 +5      10              5</code>
 +
 +아래는 population variance, sd를 구하기 위한 function
 +<code>> pvar <- function(x) {
 ++     sum((x - mean(x))**2) / length(x)
 ++ }
 +> psd <- function(x) {
 ++     sqrt (sum((x - mean(x))**2) / length(x))
 ++ }</code>
 +
 +<code>> fds <- stack(fd)
 +> tapply(fds$values, fds$ind, mean)
 +  finance marketing    policy 
 +      6.6       6.6       5.6 
 +> tapply(fds$values, fds$ind, pvar)
 +  finance marketing    policy 
 +     9.84      5.04      3.04 
 +> options(digits=5)
 +> tapply(fds$values, fds$ind, psd)
 +  finance marketing    policy 
 +   3.1369    2.2450    1.7436 
 +
 + </code>
  
 |  Standardized \\ Variable, \\ Y<sub>i</sub>  |  Observed \\ variance, S<sup>2</sup><sub>i</sub>    Loadings on  || Communality, \\ $b^2_{i1} + b^2_{i2} $  |  Percent \\ explained  |  spec. \\ variance  | |  Standardized \\ Variable, \\ Y<sub>i</sub>  |  Observed \\ variance, S<sup>2</sup><sub>i</sub>    Loadings on  || Communality, \\ $b^2_{i1} + b^2_{i2} $  |  Percent \\ explained  |  spec. \\ variance  |
factor_analysis.txt · Last modified: 2023/11/06 02:53 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki