Initial Extraction of the Components
JogglePCA<-principal(JoggleData,nfactors=8,rotate="none")
principal(r=JoggleData,nfactors=8,rotate="none")
Eigen Values
ev <- eigen(cor(JoggleData))
ev$values
## [1] 2.7241 1.2642 0.9379 0.8403 0.7325 0.5872 0.5281 0.3856
Scree Plot
ap <- parallel(subject=nrow(JoggleData),var=ncol(JoggleData), rep=100,cent=.05)
nS <- nScree(x=ev$values, aparallel=ap$eigen$qevpea)
plotnScree(nS)
Rotation to Final Solution - 3 Factors
JogglePCA.r<-principal(JoggleData,nfactors=3,rotate="promax",scores=T)
principal(r=JoggleData,nfactors=3,rotate="promax",scores=T)
## Principal Components Analysis
## Call: principal(r = JoggleData, nfactors = 3, rotate = "promax", scores = T)
## Standardized loadings (pattern matrix) based upon correlation matrix
## PC1 PC2 PC3 h2 u2
## BARTaccuracy -0.01 0.08 0.98 0.98 0.023
## DSSTefficiency 0.81 0.07 -0.05 0.69 0.310
## LOTefficiency 0.78 0.07 0.01 0.64 0.357
## PVTefficiency -0.20 0.91 0.06 0.77 0.228
## AMefficiency 0.77 -0.46 0.02 0.63 0.371
## NBACKaccuracy 0.52 -0.16 0.12 0.29 0.714
## VOLTefficiency 0.51 0.32 -0.10 0.44 0.563
## MPTspeed 0.42 0.45 0.03 0.49 0.507
##
## PC1 PC2 PC3
## SS loadings 2.57 1.35 1.00
## Proportion Var 0.32 0.17 0.13
## Cumulative Var 0.32 0.49 0.62
## Proportion Explained 0.52 0.27 0.20
## Cumulative Proportion 0.52 0.80 1.00
##
## With component correlations of
## PC1 PC2 PC3
## PC1 1.00 0.26 0.18
## PC2 0.26 1.00 0.05
## PC3 0.18 0.05 1.00
##
## Test of the hypothesis that 3 components are sufficient.
##
## The degrees of freedom for the null model are 28 and the objective function was 1.44
## The degrees of freedom for the model are 7 and the objective function was 0.4
## The total number of observations was 1793 with MLE Chi Square = 717 with prob < 1.5e-150
##
## Fit based upon off diagonal values = 0.87
Bind Factor Scores to Joggle1
load(file='/Users/meganwilliams/Desktop/HANDLS/Joggle/Joggle PCA/Joggle1.rdata')
summary(JogglePCA.r$scores)
## PC1 PC2 PC3
## Min. :-3.612 Min. :-3.686 Min. :-2.479
## 1st Qu.:-0.683 1st Qu.:-0.674 1st Qu.:-0.887
## Median : 0.081 Median :-0.098 Median : 0.130
## Mean : 0.000 Mean : 0.000 Mean : 0.000
## 3rd Qu.: 0.785 3rd Qu.: 0.670 3rd Qu.: 0.854
## Max. : 2.887 Max. : 3.370 Max. : 1.671
data=cbind(Joggle1,JogglePCA.r$scores)
summary(data)
## HNDid BARTaccuracy DSSTefficiency LOTefficiency
## Length:1793 Min. : 19 Min. : 1 Min. : 0
## Class :character 1st Qu.: 390 1st Qu.:300 1st Qu.:333
## Mode :character Median : 700 Median :428 Median :475
## Mean : 651 Mean :477 Mean :434
## 3rd Qu.: 871 3rd Qu.:655 3rd Qu.:564
## Max. :1000 Max. :981 Max. :875
## PVTefficiency AMefficiency NBACKaccuracy VOLTefficiency MPTspeed
## Min. : 4 Min. :118 Min. : 0 Min. :101 Min. : 18
## 1st Qu.: 25 1st Qu.:397 1st Qu.: 96 1st Qu.:359 1st Qu.:871
## Median :151 Median :451 Median :183 Median :400 Median :917
## Mean :243 Mean :443 Mean :203 Mean :395 Mean :886
## 3rd Qu.:450 3rd Qu.:487 3rd Qu.:274 3rd Qu.:447 3rd Qu.:967
## Max. :970 Max. :666 Max. :845 Max. :688 Max. :996
## PC1 PC2 PC3
## Min. :-3.612 Min. :-3.686 Min. :-2.479
## 1st Qu.:-0.683 1st Qu.:-0.674 1st Qu.:-0.887
## Median : 0.081 Median :-0.098 Median : 0.130
## Mean : 0.000 Mean : 0.000 Mean : 0.000
## 3rd Qu.: 0.785 3rd Qu.: 0.670 3rd Qu.: 0.854
## Max. : 2.887 Max. : 3.370 Max. : 1.671
save(data,file='/Users/meganwilliams/Desktop/HANDLS/Joggle/Joggle PCA/data.rdata')
load(file='/Users/meganwilliams/Desktop/HANDLS/Joggle/Joggle PCA/data.rdata')
jogFactors = zQ(PC1,PC2,PC3)
zCor(JoggleNeuro1[, jogFactors], JoggleNeuro1[, Neuro1VARS])
## BVRtot CrdRot IdentPicScore CVLtca DigitSpanFwd DigitSpanBck
## PC1 -0.25 0.14*** 0.41*** -0.04 -0.08** -0.04
## PC2 -0.41*** -0.03 0.29*** 0.35*** 0.31*** 0.47***
## PC3 -0.18*** 0.19*** 0.21 0.16*** 0.12*** 0.08**
## FluencyWord TrailsAtestSec TrailsBtestSec Attention ClockTotal
## PC1 0.52*** -0.24*** -0.31*** -0.06 0.03
## PC2 0.02 -0.10** -0.11*** 0.34*** 0.10***
## PC3 0.04 -0.04 -0.10*** 0.12*** 0.15***
## TrailsBminusA
## PC1 -0.27***
## PC2 -0.09**
## PC3 -0.10**
##
## n = 1133
jogFactors = zQ(PC1,PC2,PC3)
zCor(JoggleNeuro3[, jogFactors], JoggleNeuro3[, Neuro3VARS])
## BVRtot StroopInterference StroopWords CVLtca DigitSpanFwd
## PC1 -0.59 0.21*** 0.04 0.49*** 0.07
## PC2 -0.12** -0.42 0.44*** 0.03 0.31***
## PC3 -0.12** 0.01 0.08 0.12** 0.08*
## DigitSpanBck FluencyWord TrailsAtestSec TrailsBtestSec Attention
## PC1 0.14*** 0.43*** -0.31*** -0.52*** 0.38***
## PC2 0.23*** -0.05 0.03 -0.15*** 0.14***
## PC3 0.04 0.07 -0.07* -0.18*** 0.13***
## ClockTotal TrailsBminusA
## PC1 0.41*** -0.48***
## PC2 -0.19*** -0.16***
## PC3 0.07 -0.17***
##
## n = 708