Exercise

# Explore correlation between degree and strength

To review Pearson correlation, we correlate centrality measures degree and strength that we computed in the first chapter. Recall that the Pearson correlation coefficient runs from -1 (a perfect negative correlation) to 1 (a perfect positive correlation). Values close to 0 indicate no correlation.

Moreover, we use the `ggplot2`

package to draw a scatterplot among degree and strength variables adding a linear regression line.

The data frame `nodes`

, which contains the nodes of the network is at your disposal.

Instructions

**100 XP**

- Using the
`nodes`

data frame plot`strength`

vs.`degree`

.- Make it a scatter plot.
- Add a regression line with the
`geom_smooth()`

geometry and`method`

set to`"lm"`

.

- Use
`cor()`

to compute the correlation between`degree`

and`strength`

in the`nodes`

data frame. What kind of relationship do you observe?