- Loads the necessary csv files including the exclusion matrices for phase 1 and phase 2 and the qualtrics data (which includes phase 1 and phase 2 responses that have been scored and recoded). There are a couple of cleaning steps here too.
- Applies qualtrics exclusion criteria but putting in NA for those participants in the qualtrics dataframe (but keeps phase and subID as is, so that we can still find the place holders for those participants)
- Determines the number of subjects and their IDs that were in phase 1, phase 2 and both phases
- Creates the wide and long versions of the individual-level dataframes.
- Wide (subLevelWide) has a row for each participant and the variables for phase 1 and 2 are distinguished by their names that begin with "phs1_" or "phs2_".
- 544 rows with 72 variables
- Long (subLevelLong) has a row for each participant and phase (even if they didn't participate in both phases). This is so that there is a place holder for each participant and phase which was necessary for the PCA and determining which components matched with which participants
- 1088 rows with 39 variables
- Wide (subLevelWide) has a row for each participant and the variables for phase 1 and 2 are distinguished by their names that begin with "phs1_" or "phs2_".
- Scales some variables including the affective ones so that they are smaller and easier for glmer models to handle
- Plots correlograms for SES
- Does PCA analysis for SES and adds component 1 to individual-level dataframes
- Plots correlograms for covid qs
- Does PCA analysis for COVID Q
- Save individual-level dataframes as Rdata objects