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

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

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