Introduction.

This is a worksheet for use with Lecture 8.

You have a video of me narrating these slides. Note that there are potentially minor discrepancies between the current set of slides and the one in the video. The slide numbers refer to the current set. I do not cover every single slide but you can code along!

If you answer correctly the colour of the box will change! (Don't worry about bonus questions, they are very much just that: a bonus!)

Slides

Terms (Slide 8)

Can you answer the following true/false questions?

  • For factor analysis to be appropriate, the variables must be correlated.

  • Interpretation is facilitated by identifying the variables that have small loadings on the same factor.

  • The factors identified in factor analysis are overtly observed in the population.

  • A factor is an underlying dimension that explains the correlations among a set of variables.

Complete the following:

_____ are simple correlations between the variables and the factors.

  1. Factor scores
  2. Factor loadings
  3. Correlation loadings
  4. Both a and b are correct

My answer:

Please go back over the slides where we covered factor analysis. Focussed on SPSS but could also be useful, check this site or this slideshow by Eugene Kaciak

Notations (Slide 14)

f1 ~~ f2 # covariance

Complete the following.

f1 and f2 are (plural).

Assumptions (Slide 17)

Which item (2 characters) scores the would be qualified as 'miserable'

Try it yourself (Slide 22)

Return to the slides from last week.

Extract 3 factors.

Go back over the previous slides and make sure you specify the model in the same way as the example.

Try it yourself (Slide 25)

The code is on the previous slides.

Export a table (Slide 26)

Try and replicate so that you get a result table as well.

Complete the following:

  • What is the \(\beta\) for x4? (3 decimals)
  • What is the standard error for the unstandardised coefficient of x5
  • What is the Z value for x8? (3 decimals)

You can look at the result here.

True or False.

There are no p values for x1,x4,x7 as these indicators have been set to load as 1.

Same principle as with dummy variables, we can re-express all relationships in relationship to one variable! So if we have n variables, we only need n-1 coefficients. The 'final' coefficient can be expressed as a linear combination of all the other ones!

This is described in the manual, read more here.

Residuals check. (Slide 28)

Bonus

What is the largest residual correlation?

Look at the code - where are the residuals stored? How can we extract the residuals? Once you achieve this step you can find the maximum! (Check back to Week 1 on how to calculate maximum).

Try it yourself. (Slide 34)

The Sidanius data is the 'M255.sav' data you have been using all along. Apply the example code.

Massive output! (Slide 39)

Use the code to generate a similar output file.

Answer the following:

  • What is the CFI of the model? (3 decimals)
  • What is the RMSEA of the model? (3 decimals)
  • What are the estimates for the loadings of x2 for Pasteur and Grant-White, respectively? (3 decimals) and
  • What are the covariances between the visual and speed for Pasteur and Grant-White, respectively? (3 decimals) and .

You can look at the result here.

Table (Slide 44)

psytabs might not be available via 'install.packages'.

If you run into issues: You will first need to install the 'mokken', 'rtf', and the 'mft' packages.

You can then install 'psytabs' via the following command (ensure you have installed the remotes package first:

require(remotes) 
install_github('cran/psytabs')

Note that this route also works for installing packages which are no longer available. Locate them on GitHub and then install from there. More information: https://cran.r-project.org/web/packages/remotes/index.html

Exercise (Slide 47)

Complete the exercise and submit via Blackboard!

Going further.

Session Info.

Thanks to Lisa DeBruine for the webexercises package. Some of the multiple choice questions are from Eugene Kaciak, Brock university, Discovering Statistics by Andy Field and from Statistics Without Maths for Psychology, 7th Edition. Please see general disclaimer.

sessionInfo()
## R version 4.3.2 (2023-10-31)
## Platform: aarch64-apple-darwin20 (64-bit)
## Running under: macOS Ventura 13.4
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib 
## LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## time zone: Europe/London
## tzcode source: internal
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] webexercises_1.1.0
## 
## loaded via a namespace (and not attached):
##  [1] digest_0.6.33     R6_2.5.1          fastmap_1.1.1     xfun_0.41        
##  [5] cachem_1.0.8      knitr_1.45        htmltools_0.5.7   rmarkdown_2.25   
##  [9] cli_3.6.1         sass_0.4.7        jquerylib_0.1.4   compiler_4.3.2   
## [13] rstudioapi_0.15.0 tools_4.3.2       evaluate_0.23     bslib_0.5.1      
## [17] yaml_2.3.7        jsonlite_1.8.7    rlang_1.1.3

The end...