- Create a R markdown document to include your R codes and results. Submit both R markdown and rendered PDF documents to Blackboard.
- If “Knit to HTML” works, but “Knit to PDF” doesn’t, then the problem may be caused by non-standard characters including mathematical symbols, Greek letters, etc.
- Show all your work to receive full credit for a problem. However, you should not include the code chunks and results that are irrelevant to your answers. An unnecessarily lengthy solution will be penalized.
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
- Using
Computer repair data
, calculate the following quantities directly without using lm()
.
- n: sample size
- \(\bar y\), \(\bar x\), SYY, SXX, SXY
- \(\hat \beta_{0}\), \(\hat \beta_{1}\)
- (Continued) Based on the quantities you found above, answer the following questions.
- Construct the ANOVA table for a simple linear regression of Y on X.
- Find \(\hat \sigma^{2}\), the unbiased estimate of \(Var(Y|X)\).
- Find \(R^{2}\), the coefficients of determination.
- (Continued) Based on some quantities in (1) and (2),answer the following questions.
- Find \(se(\hat \beta_{1})\), the standard error of \(\hat \beta_{1}\).
- 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?
- (Continued) Based on some quantities in (1) and (2), provide the following quantities.
- Find the 95% confidence interval of \(\beta_{1}\).
- Find the 99% prediction interval of Y given X = 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.
- 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?
- 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?
- What should be the file name of this assignment?
- If the instructor fails to “Knit” your
rmd
file, how much points will you receive?
- If you do not upload either
rmd
or pdf
, how much points will you receive?
(Written) Do Exercise 2.4.
(Written) Do Exercise 2.6.