SlideShare a Scribd company logo
1 of 18
Download to read offline
R                           16


                         @holidayworking



                         2006   6   26




@holidayworking ()   R              16        2006   6   26   1 / 18
1




2




3   R




        @holidayworking ()   R   16   2006   6   26   2 / 18
)
      Twitter: @holidayworking
      :
      :
      :                   T-SQUARE        F1
      :
      Java, PL/SQL:
      Python, Ruby:




@holidayworking ()    R              16        2006   6   26   3 / 18
i                 i        i                   i


   :
       5




@holidayworking ()   R       16       2006   6   26       4 / 18
R




R                                                  factanal
factanal(x, factors, rotation = "varimax")

           x
     factors
    rotation                      (varimax)                     (promax)




    @holidayworking ()    R                   16              2006   6   26   5 / 18
5

                             1   60.00   64.00   55.00   55.00   55.00
                             2   41.00   44.00   46.00   55.00   44.00
                             3   55.00   63.00   62.00   58.00   70.00
                             4   60.00   45.00   44.00   53.00   49.00
                             5   58.00   56.00   61.00   67.00   58.00
                         (   )
                           195   64.00   47.00   52.00   42.00   48.00
                           196   39.00   36.00   35.00   38.00   36.00
                           197   42.00   43.00   43.00   57.00   39.00
                           198   64.00   58.00   47.00   33.00   56.00
                           199   49.00   47.00   46.00   49.00   54.00
                           200   51.00   51.00   49.00   50.00   46.00




    @holidayworking ()           R                 16                    2006   6   26   6 / 18
>         <- cor(            )
>

    1.0000000    0.5500166       0.1953799   0.1630274   0.4275140
    0.5500166    1.0000000       0.3317530   0.2944938   0.5178159
    0.1953799    0.3317530       1.0000000   0.5301135   0.4575891
    0.1630274    0.2944938       0.5301135   1.0000000   0.3876493
    0.4275140    0.5178159       0.4575891   0.3876493   1.0000000



                                             0.55
                                             0.53
                         4             0.39 0.52
⇒



    @holidayworking ()             R                     16          2006   6   26   7 / 18
1


> eigen(       )
$values
[1] 2.5573782 1.0656034 0.5058941 0.4461472 0.4249772

$vectors
             [,1]        [,2]       [,3]       [,4]        [,5]
[1,]   -0.4040025 0.57915506 -0.3526733 -0.30988872 0.53004894
[2,]   -0.4791362 0.36314955 -0.1046695 0.07323541 -0.78881668
[3,]   -0.4380493 -0.48395278 0.2494573 -0.71311577 -0.05603054
[4,]   -0.4064807 -0.54402387 -0.6062633 0.39786745 0.11383232
[5,]   -0.5000967 0.05029462 0.6594556 0.48142803 0.28411115




       @holidayworking ()   R                16                   2006   6   26   8 / 18
>                <- factanal(     , factors=2)
> print(              , cutoff=0)

Call:
factanal(x =        , factors = 2)
                                        Uniquenesses
                                        Loadings
Uniquenesses:
                                        SS loadings
0.471 0.395 0.379 0.548 0.491           Proportion Var
Loadings:                               Cumulative Var
     Factor1   Factor2
     0.722     0.084
     0.730     0.268
     0.177     0.768
     0.156     0.654
     0.537     0.470

                 Factor1 Factor2
SS loadings        1.399   1.317
Proportion Var     0.280   0.263
Cumulative Var     0.280   0.543

Test of the hypothesis that 2 factors are sufficient.
The chi square statistic is 0.08 on 1 degree of freedom.
      @holidayworking ()
The p-value is 0.782       R                 16            2006   6   26   9 / 18
1
>        <- 1 -                $uniquenesses
>

0.5288198 0.6049597 0.6213085 0.4523362 0.5087881




     @holidayworking ()    R                   16   2006   6   26   10 / 18
1       2
                         0.722   0.084   0.529
                         0.730   0.268   0.605
                         0.537   0.470   0.509
                         0.177   0.768   0.621
                         0.156   0.654   0.452
                         0.722   1.317


    1

⇒
    2

⇒



@holidayworking ()   R             16            2006   6   26   11 / 18
@holidayworking ()   R   16   2006   6   26   12 / 18
>                    <- factanal(     , factors=2,rotation="promax")
> print(                  , cutoff=0)

Call:
factanal(x =        , factors = 2, rotation = "promax")

Uniquenesses:

0.471 0.395 0.379 0.548 0.491

Loadings:
     Factor1   Factor2
      0.801    -0.156
      0.749     0.050
     -0.051     0.815
     -0.038     0.692
      0.461     0.348

                 Factor1 Factor2
SS loadings        1.419   1.291
Proportion Var     0.284   0.258
Cumulative Var     0.284   0.542

Test of the hypothesis that 2 factors are sufficient.
The chi square statistic is 0.08 on 1 degree of freedom.
      @holidayworking ()
The p-value is 0.782       R                 16               2006     6   26   13 / 18
>                        <- factanal(     , factors=2,rotation="none")
> print(                      , cutoff=0)

Call:
factanal(x =        , factors = 2, rotation = "none")

Uniquenesses:

0.471 0.395 0.379 0.548 0.491

Loadings:
     Factor1   Factor2
      0.583    -0.435
      0.714    -0.307
      0.657     0.436
      0.563     0.368
      0.713    -0.028

                 Factor1 Factor2
SS loadings        2.106   0.611
Proportion Var     0.421   0.122
Cumulative Var     0.421   0.543

Test of the hypothesis that 2 factors are sufficient.
The chi square statistic is 0.08 on 1 degree of freedom.
      @holidayworking ()
The p-value is 0.782       R                 16                2006   6   26   14 / 18
>                                   <- promax(loadings(              ), m=4)
> print(                                 )
$loadings

Loadings:
     Factor1 Factor2
      0.801 -0.156
      0.749
              0.815
              0.692
      0.461   0.348

                  Factor1 Factor2
SS loadings         1.419   1.291
Proportion Var      0.284   0.258
Cumulative Var      0.284   0.542

$rotmat
           [,1]      [,2]
[1,] 0.6062459 0.5303245
[2,] -1.0284319 1.0695617



     @holidayworking ()       R                   16      2006   6    26       15 / 18
rotmat

>             <- solve(t(                       $rotmat)%*%
                             $rotmat)
>
          [,1]      [,2]
[1,] 1.0000000 0.5462117
[2,] 0.5462117 1.0000000

    1                 2                 0.5462117




        @holidayworking ()   R             16                 2006   6   26   16 / 18
R                        factanal




@holidayworking ()   R         16   2006   6   26   17 / 18
@holidayworking ()   R   16   2006   6   26   18 / 18

More Related Content

Similar to Rによるやさしい統計学 第16章 : 因子分析

Caracterizacion motor
Caracterizacion motorCaracterizacion motor
Caracterizacion motor
Diego Eslava
 
Teleconferência de resultados 1 t03 (versão inglês)
Teleconferência de resultados 1 t03 (versão inglês)Teleconferência de resultados 1 t03 (versão inglês)
Teleconferência de resultados 1 t03 (versão inglês)
Braskem_RI
 
qwest communications 1231 06
qwest communications 1231 06qwest communications 1231 06
qwest communications 1231 06
finance19
 
Duty Computation 0ther
Duty Computation 0therDuty Computation 0ther
Duty Computation 0ther
cavijayprakash
 

Similar to Rによるやさしい統計学 第16章 : 因子分析 (20)

Refuerzo
RefuerzoRefuerzo
Refuerzo
 
Refuerzo
RefuerzoRefuerzo
Refuerzo
 
Tabla fischer una cola alfa 0.05
Tabla fischer una cola alfa 0.05Tabla fischer una cola alfa 0.05
Tabla fischer una cola alfa 0.05
 
基礎からのベイズ統計学 輪読会資料 第8章 「比率・相関・信頼性」
基礎からのベイズ統計学 輪読会資料  第8章 「比率・相関・信頼性」基礎からのベイズ統計学 輪読会資料  第8章 「比率・相関・信頼性」
基礎からのベイズ統計学 輪読会資料 第8章 「比率・相関・信頼性」
 
Regression project
Regression projectRegression project
Regression project
 
recipes
recipesrecipes
recipes
 
Conference ppt
Conference pptConference ppt
Conference ppt
 
墾丁列車問卷調查
墾丁列車問卷調查墾丁列車問卷調查
墾丁列車問卷調查
 
Renewable energy transmission [CSTP 2009]
Renewable energy transmission [CSTP 2009]Renewable energy transmission [CSTP 2009]
Renewable energy transmission [CSTP 2009]
 
VaR of Operational Risk
VaR of Operational RiskVaR of Operational Risk
VaR of Operational Risk
 
Caracterizacion motor
Caracterizacion motorCaracterizacion motor
Caracterizacion motor
 
A Study on the Short Run Relationship b/w Major Economic Indicators of US Eco...
A Study on the Short Run Relationship b/w Major Economic Indicators of US Eco...A Study on the Short Run Relationship b/w Major Economic Indicators of US Eco...
A Study on the Short Run Relationship b/w Major Economic Indicators of US Eco...
 
Teleconferência de resultados 1 t03 (versão inglês)
Teleconferência de resultados 1 t03 (versão inglês)Teleconferência de resultados 1 t03 (versão inglês)
Teleconferência de resultados 1 t03 (versão inglês)
 
Risk and Return
Risk and ReturnRisk and Return
Risk and Return
 
Trigonotabel
TrigonotabelTrigonotabel
Trigonotabel
 
General motors straddle volatility strategy
General motors straddle  volatility strategyGeneral motors straddle  volatility strategy
General motors straddle volatility strategy
 
qwest communications 1231 06
qwest communications 1231 06qwest communications 1231 06
qwest communications 1231 06
 
Weld induced residual stress
Weld induced residual stressWeld induced residual stress
Weld induced residual stress
 
zavada-sussex-2008
zavada-sussex-2008zavada-sussex-2008
zavada-sussex-2008
 
Duty Computation 0ther
Duty Computation 0therDuty Computation 0ther
Duty Computation 0ther
 

More from Hidekazu Tanaka (10)

データベースのお話
データベースのお話データベースのお話
データベースのお話
 
フォントのお話
フォントのお話フォントのお話
フォントのお話
 
フォントのお話
フォントのお話フォントのお話
フォントのお話
 
バギングで構築された各決定木
バギングで構築された各決定木バギングで構築された各決定木
バギングで構築された各決定木
 
アンサンブル学習
アンサンブル学習アンサンブル学習
アンサンブル学習
 
RHadoop の紹介
RHadoop の紹介RHadoop の紹介
RHadoop の紹介
 
Rの紹介
Rの紹介Rの紹介
Rの紹介
 
Rで解く最適化問題 線型計画問題編
Rで解く最適化問題   線型計画問題編 Rで解く最適化問題   線型計画問題編
Rで解く最適化問題 線型計画問題編
 
R meets Hadoop
R meets HadoopR meets Hadoop
R meets Hadoop
 
RでMapreduce
RでMapreduceRでMapreduce
RでMapreduce
 

Recently uploaded

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
UK Journal
 

Recently uploaded (20)

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4j
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 

Rによるやさしい統計学 第16章 : 因子分析

  • 1. R 16 @holidayworking 2006 6 26 @holidayworking () R 16 2006 6 26 1 / 18
  • 2. 1 2 3 R @holidayworking () R 16 2006 6 26 2 / 18
  • 3. ) Twitter: @holidayworking : : : T-SQUARE F1 : Java, PL/SQL: Python, Ruby: @holidayworking () R 16 2006 6 26 3 / 18
  • 4. i i i i : 5 @holidayworking () R 16 2006 6 26 4 / 18
  • 5. R R factanal factanal(x, factors, rotation = "varimax") x factors rotation (varimax) (promax) @holidayworking () R 16 2006 6 26 5 / 18
  • 6. 5 1 60.00 64.00 55.00 55.00 55.00 2 41.00 44.00 46.00 55.00 44.00 3 55.00 63.00 62.00 58.00 70.00 4 60.00 45.00 44.00 53.00 49.00 5 58.00 56.00 61.00 67.00 58.00 ( ) 195 64.00 47.00 52.00 42.00 48.00 196 39.00 36.00 35.00 38.00 36.00 197 42.00 43.00 43.00 57.00 39.00 198 64.00 58.00 47.00 33.00 56.00 199 49.00 47.00 46.00 49.00 54.00 200 51.00 51.00 49.00 50.00 46.00 @holidayworking () R 16 2006 6 26 6 / 18
  • 7. > <- cor( ) > 1.0000000 0.5500166 0.1953799 0.1630274 0.4275140 0.5500166 1.0000000 0.3317530 0.2944938 0.5178159 0.1953799 0.3317530 1.0000000 0.5301135 0.4575891 0.1630274 0.2944938 0.5301135 1.0000000 0.3876493 0.4275140 0.5178159 0.4575891 0.3876493 1.0000000 0.55 0.53 4 0.39 0.52 ⇒ @holidayworking () R 16 2006 6 26 7 / 18
  • 8. 1 > eigen( ) $values [1] 2.5573782 1.0656034 0.5058941 0.4461472 0.4249772 $vectors [,1] [,2] [,3] [,4] [,5] [1,] -0.4040025 0.57915506 -0.3526733 -0.30988872 0.53004894 [2,] -0.4791362 0.36314955 -0.1046695 0.07323541 -0.78881668 [3,] -0.4380493 -0.48395278 0.2494573 -0.71311577 -0.05603054 [4,] -0.4064807 -0.54402387 -0.6062633 0.39786745 0.11383232 [5,] -0.5000967 0.05029462 0.6594556 0.48142803 0.28411115 @holidayworking () R 16 2006 6 26 8 / 18
  • 9. > <- factanal( , factors=2) > print( , cutoff=0) Call: factanal(x = , factors = 2) Uniquenesses Loadings Uniquenesses: SS loadings 0.471 0.395 0.379 0.548 0.491 Proportion Var Loadings: Cumulative Var Factor1 Factor2 0.722 0.084 0.730 0.268 0.177 0.768 0.156 0.654 0.537 0.470 Factor1 Factor2 SS loadings 1.399 1.317 Proportion Var 0.280 0.263 Cumulative Var 0.280 0.543 Test of the hypothesis that 2 factors are sufficient. The chi square statistic is 0.08 on 1 degree of freedom. @holidayworking () The p-value is 0.782 R 16 2006 6 26 9 / 18
  • 10. 1 > <- 1 - $uniquenesses > 0.5288198 0.6049597 0.6213085 0.4523362 0.5087881 @holidayworking () R 16 2006 6 26 10 / 18
  • 11. 1 2 0.722 0.084 0.529 0.730 0.268 0.605 0.537 0.470 0.509 0.177 0.768 0.621 0.156 0.654 0.452 0.722 1.317 1 ⇒ 2 ⇒ @holidayworking () R 16 2006 6 26 11 / 18
  • 12. @holidayworking () R 16 2006 6 26 12 / 18
  • 13. > <- factanal( , factors=2,rotation="promax") > print( , cutoff=0) Call: factanal(x = , factors = 2, rotation = "promax") Uniquenesses: 0.471 0.395 0.379 0.548 0.491 Loadings: Factor1 Factor2 0.801 -0.156 0.749 0.050 -0.051 0.815 -0.038 0.692 0.461 0.348 Factor1 Factor2 SS loadings 1.419 1.291 Proportion Var 0.284 0.258 Cumulative Var 0.284 0.542 Test of the hypothesis that 2 factors are sufficient. The chi square statistic is 0.08 on 1 degree of freedom. @holidayworking () The p-value is 0.782 R 16 2006 6 26 13 / 18
  • 14. > <- factanal( , factors=2,rotation="none") > print( , cutoff=0) Call: factanal(x = , factors = 2, rotation = "none") Uniquenesses: 0.471 0.395 0.379 0.548 0.491 Loadings: Factor1 Factor2 0.583 -0.435 0.714 -0.307 0.657 0.436 0.563 0.368 0.713 -0.028 Factor1 Factor2 SS loadings 2.106 0.611 Proportion Var 0.421 0.122 Cumulative Var 0.421 0.543 Test of the hypothesis that 2 factors are sufficient. The chi square statistic is 0.08 on 1 degree of freedom. @holidayworking () The p-value is 0.782 R 16 2006 6 26 14 / 18
  • 15. > <- promax(loadings( ), m=4) > print( ) $loadings Loadings: Factor1 Factor2 0.801 -0.156 0.749 0.815 0.692 0.461 0.348 Factor1 Factor2 SS loadings 1.419 1.291 Proportion Var 0.284 0.258 Cumulative Var 0.284 0.542 $rotmat [,1] [,2] [1,] 0.6062459 0.5303245 [2,] -1.0284319 1.0695617 @holidayworking () R 16 2006 6 26 15 / 18
  • 16. rotmat > <- solve(t( $rotmat)%*% $rotmat) > [,1] [,2] [1,] 1.0000000 0.5462117 [2,] 0.5462117 1.0000000 1 2 0.5462117 @holidayworking () R 16 2006 6 26 16 / 18
  • 17. R factanal @holidayworking () R 16 2006 6 26 17 / 18
  • 18. @holidayworking () R 16 2006 6 26 18 / 18