# Set up some fake data
set.seed(390)
# Predictor
x <- rnorm(100, mean = -3, sd = 1)
# Noise
error <- rnorm(100, mean = 0)
# Variable we want to explain
y<- x + error
# Measure the relationship
cov(x, y) # covariance
[1] 1.105927
[1] 0.7318479
x
1.098033