This is a worksheet for use with Lecture 9.
You have a videos 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!)
Think back to a couple of weeks ago where we build mediation models.
Please complete the following.
Mediation models are related to _____ models
My answer:
Go back over the slides from session 6
Please complete the following.
In the session we first used Baron and Kenny's steps approach.
, Aroian and Goodman's test were then covered.
Next we used the '' package to test the mediation via bootstrapping.
The '' package can be used to calculate analyses, such as \(R^2_M*R^2_Y\) and \(\widetilde{R^2_M}\widetilde{R^2_Y}\).
Go back over the slides from session 6 in chronological order. We are looking for one word in each gap.
We have used 'lavaan' also to model latent factors, which symbols were used to indicate a factor? '' (2 symbols)
Code along.
What is the estimate of the 'ab path': (3 decimals).
True or False.
The conclusion on the size of the mediation effect is the same regardless of using 'lavaan' or 'mediate'.
Code along and evaluate the model.
The AIC and the BIC for this model are and respectively.
Go back over the slides from Week 1 if you don't recall how to load a dataset.
Try not to click the solution on the following slide but complete all the tasks. Ask your neighbour or tutor for advice.
The input for getCov() in this case is a
My answer:
Have a look in the help function and look up getCov()
Discuss with your group members. Think back over the previous session.
What is missing from the diagram
My answer:
Look back over slide 31 and compare to the Figure.
Complete the exercise and submit via Blackboard!
Thanks to Lisa DeBruine for the webexercises package. Please see general disclaimer.
sessionInfo()
## R version 4.2.1 (2022-06-23)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Big Sur ... 10.16
##
## Matrix products: default
## BLAS: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
##
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] webexercises_1.0.0
##
## loaded via a namespace (and not attached):
## [1] digest_0.6.31 R6_2.5.1 jsonlite_1.8.4 evaluate_0.20
## [5] cachem_1.0.7 rlang_1.1.0 cli_3.6.1 rstudioapi_0.14
## [9] jquerylib_0.1.4 bslib_0.4.2 rmarkdown_2.21 tools_4.2.1
## [13] xfun_0.38 yaml_2.3.7 fastmap_1.1.1 compiler_4.2.1
## [17] htmltools_0.5.5 knitr_1.42 sass_0.4.5