STAT 540 Homework 1 (see NOTES at bottom) Given the following data set: X Y 35.0 13.7 41.8 16.7 42.6 16.4 33.2 9.2 47.2 13.8 53.7 17.8 34.0 19.6 34.3 13.3 42.0 21.8 58.8 15.7 47.3 11.1 36.0 12.6 47.8 12.0 44.6 14.1 29.1 11.2 First, create two vectors in R that hold the X values and the Y values. (For the purposes of this assignment, it's probably easiest to just create the vectors using the c() function.) Then use R to calculate the following things WITHOUT using R's built-in functions to calculate them directly. 1. Calculate the (sample) mean of the values for Y. 2. Calculate the (sample) standard deviation of the values for Y. 3. Calculate the correlation coefficient between the X values and the Y values. 4. Calculate the slope and intercept of the equation of the simple linear regression line for Y regressed on X (i.e., Y as the dependent variable, X as the independent variable). If necessary, you should look up the formulas for these tasks in a resource (such as any introductory statistics book). Again, you may not use the R functions "mean", "sd", "cor" or "lm" which would calculate these directly (except to check your answers). You may use other R functions such as "sum" or "length" in your program. 5. Create a matrix in R that has the X values above as its first column and the Y values above as its second column. 6. From that matrix, create another matrix that consists of the odd-numbered rows of the matrix you just created. Have R print this smaller matrix to the console. NOTE: You MUST intersperse comments (lines that start with #) in your code to explain what your R statements are supposed to be doing. Please be generous with your comments, since you will be graded not only on the correctness of the code, but also on the clarity and amount of comments. NOTE: PLEASE put WITHIN COMMENTS (in lines that start with #) any text (i.e., if you choose to include problem numbers, problem description, your personal comments, output/results) in your file that is not actual R code. This will make it easier and faster to grade. The grader should be able to copy and paste your entire file into R and have it run correctly. NOTE: Submit your solution code by uploading your file in Blackboard. A plain text file (e.g., a .txt file, which you can create with a simple text editor such as Notepad or some similar editor) is best. If using MS Word to create your file, use the "Courier New" font. You can choose "Save As" ... "Plain Text" when saving in Word. Save your file with a name such as YourLastName_YourFirstName_STAT540_HW1.txt