Noverber 23, 2023

This Workgroup Meeting

1. Some examples on processing

2. Continue with processing of the data set

Assignment 1

You perform a multiple linear regression analysis in R and report this using R markdown. The assignment will be graded on the following four elements:


  • Context: Introduction of your research questions, description and potential processing of your data. (Week 1 & 2)
  • Exploratory data analysis: Inspection of potential interesting relations in the data. (Week 3)
  • Linear regression: Description of the building process, the model fit, and the model comparison procedure. (Week 4)
  • Assumptions: Testing of model assumptions, checking for outliers and influential cases. Act upon and reflect on violations when needed.(Week 5)
  • Interpretation: Substantive interpretation of the final model. Answers to your research questions. (Week 5)
  • Layout: Structure of the document, output is efficiently presented, custom functions are developed when needed. Graphs are used where fitting. (Week 3)

Find the complete assignment description on the course web site.

Processing Examples - 1

Incorrect variable classes

Character classes are not always automatically set correctly, see for example the picture below. These classes should be adjusted with functions as as_factor() or as_numeric().

Processing Examples - 2

NA’s as categories/Recoding of variables


Processing Examples - 3

Total scores & Sum scores

Some variables need to be computed into new variables, such as scale totals in the example below.

Processing Examples - 4

Linking data sets

When 2 data sets need to be combined, you can simply bind them rbind(df1, df2) for new observations (rows), or cbind(df1, df2) when new variables can be added together (same observations).


If, however, only some observations are the same, you can join the two data frames (full_join(df1, df2, by = "identification_variable")). This could be used for the 2 data frames shown below.

Remainder of the meeting

Continue with preprocessing your data set, this should ideally be finished at the end of this meeting.

For the next meeting

Keep working on Assignment 1