Data sets

library(data.table)
marr_path = "http://www.stat.tamu.edu/~sheather/book/docs/datasets/"
rae_path = "http://www1.aucegypt.edu/faculty/hadi/RABE5/Data5/"
cw_path = "https://elearn.uta.edu/bbcswebdav/courses/2182-REGRESSION-ANALYSIS-30192-001/MATH5358/doc/data/"

Example: Computer repair data

df = fread(paste0(rae_path, "P031.txt"), data.table=F)
  • Y: length of service calls
  • X: number of units repaired

Consider a simple linear regression: \(Y = \beta_{0} + \beta_{1} X + \epsilon\).

Questions

  1. Using Computer repair data, calculate the following quantities directly without using lm().
    1. n: sample size
    2. \(\bar y\), \(\bar x\), SYY, SXX, SXY
    3. \(\hat \beta_{0}\), \(\hat \beta_{1}\)
  2. (Continued) Based on the quantities you found above, answer the following questions.
    1. Construct the ANOVA table for a simple linear regression of Y on X.
    2. Find \(\hat \sigma^{2}\), the unbiased estimate of \(Var(Y|X)\).
    3. Find \(R^{2}\), the coefficients of determination.
  3. (Continued) Based on some quantities in (1) and (2),answer the following questions.
    1. Find \(se(\hat \beta_{1})\), the standard error of \(\hat \beta_{1}\).
    2. Find the t-statistic for testing \(H_{0}: \beta_{1} = 0\) vs \(H_{1}: \beta_{1} \neq 0\). Calculate the p-value. At 0.05 significance level, do you conclude that there is the linear association between X and Y?
  4. (Continued) Based on some quantities in (1) and (2), provide the following quantities.
    1. Find the 95% confidence interval of \(\beta_{1}\).
    2. Find the 99% prediction interval of Y given X = 5.
  5. Review the syllabus (find one in this link. Do not use the hard copy you received during the first day) and Lecture 1 to answer the following questions.
    1. Suppose a student earned 240 points for the homework assignment, 85 (out of 100) for Midterm 1, 95 (out of 100) for Midterm 2, 95 (out of 100) for the final project. What will be the final grade of this student?
    2. Suppose a student earned 320 points for the homework assignment, 77 (out of 100) for Midterm 1, 87 (out of 100) for Midterm 2, 82 (out of 100) for the final project. What will be the final grade of this student?
    3. What should be the file name of this assignment?
    4. If the instructor fails to “Knit” your rmd file, how much points will you receive?
    5. If you do not upload either rmd or pdf, how much points will you receive?
  6. (Written) Do Exercise 2.4.

  7. (Written) Do Exercise 2.6.