Using longitudinal random-intercept cross-lagged panel modelling to study the antecedents of mask wearing in the United States.
All data for this project can be found in the /data folder. To download the data, either git clone this repository or download the repository as a .zip file.
To run this code, you will need to install R and the following R packages:
install.packages(c("arm", "broom.mixed", "cowplot", "dagitty", "ggarchery",
"ggdag", "ggeffects", "ggraph", "huxtable", "jtools",
"knitr", "kableExtra", "lavaan", "lme4", "lmerTest",
"lubridate", "MuMIn", "papaja", "rnaturalearth",
"rnaturalearthdata", "scales", "semTools", "sf",
"targets", "tarchetypes", "tidyverse", "zipcodeR"))
- Set the working directory to this code repository
setwd("myPath/covidMaskWearing")on your local machine - Load the
targetspackage withlibrary(targets) - To run all analyses, run
tar_make() - To load individual targets into your environment, run
tar_load(riclpm)etc. - You can then view the model parameters by loading the
lavaanpackage withlibrary(lavaan)and then runningsummary(riclpm)
Any issues, please email scott.claessens@gmail.com.
Scott Claessens, scott.claessens@gmail.com