Note, I converted the file to .csv and deleted one of the rows beforehand because two of them were headers / non-data
dat <- read.csv("~/Downloads/Lacour FA Columns.csv") # importing the data as "dat"
library(psych) # library used for doing factor analysis
# perform parallel analysis on “dat”
par=fa.parallel(dat, fm = 'minres', fa = 'fa')
## Parallel analysis suggests that the number of factors = 1 and the number of components = NA
Thankfully, this plot gives an unambiguous evidence that these items collectively reflect only one underlying factor. The eigen value for the 1st factor is…
par$fa.values
## [1] 2.61613108 0.10481172 0.08659155 -0.03460391 -0.15679998
2.62 and the second one is only 0.10.
one.factor = fa(dat, nfactors = 1,rotate = "oblimin",fm="minres") # using an oblique rotation ("oblimin") and minimizing residuals ("minres"). Very boilerplate stuff.
one.factor$loadings
##
## Loadings:
## MR1
## How.many.years.have.you.studied.music....x.Years 0.902
## How.many.years.have.you.played.an.instrument.or.performed....x.years 0.942
## How.many.hours.per.week.do.you.practice....x.hours 0.809
## Do.you.consider.yourself.a.musician. 0.374
## Music.theory.score 0.348
##
## MR1
## SS loadings 2.616
## Proportion Var 0.523
The first three items are pretty strong indicators of the latent variable. Whether they consider themselves a musician and their music theory score are also indicators of the latent variable, but much less so.
f.scores=predict.psych(one.factor,dat)
We are estimating people’s location on the spectrum of the latent trait. We’re doing so by feeding each individual’s data on the 5 variables through the factor loadings to calculate the implied score on the latent trait.
I’m going to “comment out” these commands so they don’t run when this is posted online. Just showing my work.
# dat$f.scores=f.scores
# write.csv(dat,"f.score data.csv")