The data are provided in three files, one describing data from the 2019 administration of the survey, and another two to describe data from the 2020 administration.

You will need to merge the 2019 and 2020 data sets, within R, to do the project work.

How do I merge the data?

Suppose you have imported the data into R and created three tibbles, each of which contain one of the data sets Dr. Love has provided.

First, you’ll need to combine the 2020 data from the two tibbles you create for them. The 2020a file contains the first 32 variables, and the 2020b file contains the remaining ones. Faced with a similar problem in the Study 1 Demonstration, I was able to join the columns from the two tibbles to obtain a new tibble, using the inner_join() function from the dplyr package.

Next, you’ll need to combine the 2019 and the 2020 data (now that all the 2020 data are together in one tibble) to create your final merged tibble.

Then, to create a merged version of the data including all subjects from both tibbles, we could use any of the following to combine the two tibbles into one:

each of which is part of the dplyr package, which is part of the core tidyverse. There is no reason to use more than one of these approaches. Simply pick one that works for you, and use that, as I did in the Study 1 Demonstration Project, for instance.

To learn more about merging in R, I suggest:

  1. RStudio’s Data Transformation Cheat Sheet has some descriptions of methods for Combining Tables, with illustrations.
  2. The folks at STAT545 have a great “cheat sheet” on this as well, which has a more expansive description of some of the ideas.
  3. The material on Relational Data in R for Data Science should also give you a useful introduction to the ideas and code involved.

After you create the merged tibble, be certain that you haven’t introduced any problems.

What do the data sets look like?

Dr. Love placed a Google Sheet called “Fall 2020 Project B Study 1 Class Survey Items and Scales” in the Project B folder in our Shared Google Drive. As always, you’ll have to be logged into Google via CWRU to see the Sheet.

That sheet contains the following tabs:

This page was last updated: 2020-12-06 13:42:22.

431 Footer