Exercise

# Some correlations

It is also interesting to calculate some correlations, because you can get mathematical or computational problems when two predictor variables are highly correlated.

Recall that when two predictor variables in a glm are so highly correlated that they are essentially redundant, it can become difficult to estimate the values associated with each predictor. So in the case of **multicolinearity** you can run into **problems**.

The question is now: can centering avoid this problem? To answer this question, you first have to calculate some correlations.

Instructions

**100 XP**

- Calculate the
**correlations between working memory capacity and the product terms**`wm_d1`

and`wm_d2`

. Remember that`wm_d1`

equals the product between wm and`d1`

and the same holds for`d2`

. First calculate these correlations using the initial data and then use the centered data. Recall that the product terms of the centered data were called`wm_d1_centered`

and`wm_d2_centered`

. Calculate the correlations with the function`cor()`

. - Calculate the
**correlations between the dummy variables and the product terms**`wm_d1`

and`wm_d2`

. First calculate these correlations using the initial data and then use the centered data. Calculate the correlations with the`cor()`

function.