## you have to write code below every line that starts with #. Lines that start with ##provide explanations # clear the workspace # run the following x <- c(14, 51, 80, 90, 92, 24, 58, 93, 75, 88, 2, 86, 96, 38, 10, 81, 32, 40, 39, 87, 30, 1, 76, 72, 12, 3, 9, 100, 13, 64, 20, 16, 62, 60, 84, 25, 36, 83, 11, 85, 74, 5, 15, 19, 17, 56, 37, 42, 91, 57, 77, 31, 52, 89, 43, 27, 34, 35, 22, 23, 49, 26, 7, 94, 41, 78, 82, 95, 48, 59, 68, 4, 65, 98, 55, 66, 47, 54, 61, 33, 29, 21, 70, 50, 69, 67, 97, 8, 99, 79, 71, 6, 53, 45, 28, 73, 44, 63, 46, 18) y <- c(13.551840, 51.434836, 80.252956, 90.165851, 92.870000, 23.995537, 57.836892, 93.074272, 74.810066, 88.394221, 1.914372, 86.129191, 96.120087, 38.446182, 9.990359, 80.530936, 31.867903, 39.557738, 38.749904, 87.338451, 30.704536, 1.475262, 75.886176, 71.677403, 12.441984, 3.770516, 8.496171, 100.602894, 12.753607, 62.769544, 20.417328, 15.947608, 62.620215, 60.016683, 84.362122, 24.253217, 36.194441, 83.255758, 10.679809, 84.912946, 74.043807, 4.523750, 14.379435, 19.043388, 17.276730, 55.920315, 37.124241, 42.090735, 91.257348, 57.020765, 77.695803, 30.848082, 52.796755, 89.393532, 43.227776, 27.043328, 34.404375, 35.870330, 21.677848, 23.508923, 48.549212, 25.972934, 7.468727, 94.688478, 40.307540, 78.409575, 82.249394, 94.763137, 49.296887, 58.864297, 67.055232, 4.536533, 65.405809, 96.964222, 54.887709, 66.414648, 47.023350, 54.480292, 60.789443, 32.713766, 28.605546, 19.921819, 70.124937, 50.197313, 69.231455, 66.641975, 96.793975, 7.913966, 98.617741, 79.593726, 71.108265, 6.560530, 53.223912, 44.877882, 28.889231, 71.926175, 43.629351, 63.516276, 46.226669, 17.220122) data <- data.frame(x,y) # Regress y on x (ie y is DV, x is IV) and assign it to an object called fit # print fit # create a scatterplot of x and y # add the fitted regression line # based on the regression, what are the predicted y-values for each observation? Print the vector of predicted values # what is the model fit (R2)? ## let's say the observations above are students, y is the number of points they receive in the final exam, and x is the number of points they receive in the midterm # Write a sentence that explains how we can interpret the intercept # Write a sentence that explains how we can interpret the slope coefficient