Question
Using the data provided in regression.csv estimate a linear regression of
y on x and answer the following questions.
-
x and y are not significantly correlated / y increases significantly with x / y decreases significantly with x
-
Estimated slope with respect to x:
Solution
To replicate the analysis in R:
## data
d <- read.csv("regression.csv")
## regression
m <- lm(y ~ x, data = d)
summary(m)
## visualization
plot(y ~ x, data = d)
abline(m)