Complete all Questions and submit your final PDF under the Project Assignments in Canvas.
General Instructions
Group Work and Important Dates
You may work individually or in a group of two to three students. If working in a group, include the full names of all group members in your submission.
Part I (Midterm Submission): Due October 31. Submit your completed project as a PDF under Project Assignments in Canvas.
Part II (Final Submission): Due December 11. Submit your completed project as a PDF under Project Assignments in Canvas. Part II will be released after Part I.
Project Setup and Completing the Template
Organizing Your Project Files: Create a new folder on your computer’s Desktop, or a new project in Posit Cloud, named STA 112 Project. Keep your R Markdown file and all other project-related files in this location throughout the semester.
Project Template: The R Markdown template (
.Rmd) and a PDF copy are provided on Canvas. Download the R Markdown file and complete your work directly in that file. Do not change the overall format or organization of the template. Do not delete or modify the questions or section headings. Before editing the Rmd file, try knit to PDF to see if the file is compiling. If not, see the following instruction.Installing TinyTeX (for students using RStudio on their own computers): If you cannot knit your R Markdown file to PDF, run the following commands in the R console:
You only need to install TinyTeX once. Students using Posit Cloud should try knitting directly to PDF first.
R Code: Write the appropriate R code in the code chunks provided under each question. You may add additional code chunks if necessary.
Written Answers: Replace “Write your answer here.” with your own written responses. Similarly, replace
# Write your R code herewith the appropriate R code. Do not leave these placeholders in your submission.Code and Output: Include the relevant R code, figures, and output requested in each question. Avoid unnecessary code or output unrelated to the question.
Feedback, Revisions, and Submission
Feedback and Corrections: After evaluating Part I, I will provide feedback and may suggest corrections or improvements. Points may be deducted from your Part I submission. You will incorporate the suggested changes when completing Part II. If you correctly address all the feedback provided on Part I, you will receive back the points deducted from your midterm project submission.
Reproducibility: Your R Markdown file must run successfully from beginning to end in a fresh R session. Do not rely on objects created only in the R console.
Final Check: Knit your completed R Markdown file to PDF and verify that all questions, code, figures, and written interpretations appear correctly before submitting it to Canvas.
Instructions for Part I
- Complete Questions 1–17 in the provided R Markdown project template.
- Question 1: Refer to Lab 1.
- Questions 2–5: Refer to Lab 2.
- Questions 6–8 and 16: Refer to Lab 4.
- For other questions, consult the relevant lecture notes and lab materials.
Writing Statistical Hypotheses
When writing the null and alternative hypotheses for a test involving a regression slope, you may use the following LaTeX code in your R Markdown file:
$$
\begin{aligned}
H_0 &: \beta_1 = 0 \\
H_a &: \beta_1 \neq 0
\end{aligned}
$$
For example, the above code produces:
\[ \begin{aligned} H_0 &: \beta_1 = 0 \\ H_a &: \beta_1 \neq 0 \end{aligned} \]
Make sure that your hypotheses correspond to the specific question being investigated.
Instructions for Part II
- Open your .Rmd file from the Midterm submission.
- Open the blank markdown file for the final project in another tab.
- Copy everything below the section Multiple Linear Regression (Line 367 and below) in the blank Rmd file, and paste it to your midterm submission file. You will continue working on the midterm submission file.
- Complete Questions 18–36 in the provided R Markdown project template.
- Address any comment I have made on canvas for the midterm submission, and change your Q1 to Q17 accordingly. You will get back the lost points on midterm project if you address them in the final version!!
- Finally, knit the markdown file to a pdf file.
- Question 18-32: Mainly refer to Lab 5.
- Questions 33–35: Refer to Lab 6.
- For other questions, you may have to consult the relevant lecture notes and lab materials.
ANOVA Table
If your regression model is named model_1, you can get
the anova table using the code:
anova(model_1)
Nested F Test
If model_1 is nested in model_2, then use
the following code to get the nested F test table:
anova(model_1,model_2)