User Tools

Site Tools


principal_component_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
Last revisionBoth sides next revision
principal_component_analysis [2019/11/15 09:59] hkimscilprincipal_component_analysis [2019/11/15 22:46] – [e.g. saq] hkimscil
Line 1: Line 1:
 ====== PCA ====== ====== PCA ======
-Difference between PCA and FA+[[https://www.theanalysisfactor.com/the-fundamental-difference-between-principal-component-analysis-and-factor-analysis/|Difference between PCA and FA]] 
   * Both are data reduction techniques — they allow you to capture the variance in variables in a smaller set.   * Both are data reduction techniques — they allow you to capture the variance in variables in a smaller set.
   * Both are usually run in stat software using the same procedure, and the output looks pretty much the same.   * Both are usually run in stat software using the same procedure, and the output looks pretty much the same.
Line 160: Line 160:
   ggtitle("eigen on cov(t(data.matrix))")   ggtitle("eigen on cov(t(data.matrix))")
 </code> </code>
 +
 +====== e.g. saq ======
 +SPSS Anxiety Questionnaire
 +{{:r:saq8.csv}}
 +
 +
 +
 +<code>
 +# saq <- read.csv("http://commres.net/wiki/_media/r/saq.csv", header = T)
 +saq8 <- read.csv("http://commres.net/wiki/_media/r/saq8.csv", header = T)
 +head(saq8)
 +saq8 <- saq8[c(-1)]
 +</code>
 +
 +<code>
 +> round(cor(saq8),3)
 +              stat_cry afraid_spss sd_excite nmare_pearson du_stat lexp_comp comp_hate good_math
 +stat_cry         1.000      -0.099    -0.337         0.436   0.402     0.217     0.305     0.331
 +afraid_spss     -0.099       1.000     0.318        -0.112  -0.119    -0.074    -0.159    -0.050
 +sd_excite       -0.337       0.318     1.000        -0.380  -0.310    -0.227    -0.382    -0.259
 +nmare_pearson    0.436      -0.112    -0.380         1.000   0.401     0.278     0.409     0.349
 +du_stat          0.402      -0.119    -0.310         0.401   1.000     0.257     0.339     0.269
 +lexp_comp        0.217      -0.074    -0.227         0.278   0.257     1.000     0.514     0.223
 +comp_hate        0.305      -0.159    -0.382         0.409   0.339     0.514     1.000     0.297
 +good_math        0.331      -0.050    -0.259         0.349   0.269     0.223     0.297     1.000
 +
 +</code>
 +
 +
 +
principal_component_analysis.txt · Last modified: 2019/11/16 15:06 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki