Exam 1

  1. Question

    Using the data provided in regression.csv estimate a linear regression of y on x and answer the following questions.


    1. x and y are not significantly correlated / y increases significantly with x / y decreases significantly with x
    2. 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)