University of Toronto Mississauga
STA302 – Fall 2019 Assignment # 1
Due Date: Thursday, September 26th 2019, between 12:15 and 13:00 hrs.
Last Name / Surname (please print): First Name (please print):
Student Number:
Instructor: Al Nosedal TA : Julian Braganza
INSTRUCTIONS and POLICIES:
• Answer each of the questions.
• Please, attach a printed version of your code and plots to your assignment. Failure to provide a printed copy of R code and graphs may result in receiving no marks.
• Recall that missed assignments earn a mark of zero; no exceptions.
Medical certificates and/or other valid documentation are not accepted.
• Late submissions will not be accepted. A hard copy of the assignment should be handed during lecture on the due date – email submissions are not accepted.
Question
1
2
TOTAL
Value
0
10
10
Mark Earned
GOOD LUCK !
STA302 – Fall 2019: Assignment # 1 Page 1 of 3
Problem 1. (0 marks; ZERO MARKS) Please do the following:
a) Get assignment 1, part 1.
Step 0. Create folder sta302.
Step 1. Go to Quercus and download file STA302H5-B.swc
Step 2. Save STA302H5-B.swc and place it in the folder you created previously (sta302).
b) Install swirl and our course.
Step 0. Launch R
Step 1. Install swirl. Just type:
install.packages(“swirl”)
Step 2. Set sta302 as your working directory.
Step 3. Load library swirl. Just type:
library(“swirl”) Step 4. Type:
install_course()
Step 5. Double-click on STA302H5-B.swc file.
c) Cover assignment 1, part 1. Step 1. Type:
swirl( )
Step 2. Choose our course (that is, STA302H5-B) Step 3. Choose a lesson (Assignment 1, in this case)
STA302 – Fall 2019: Assignment # 1
Page 2 of 3
Problem 2. (10 marks; 2 each) Is it possible to predict the annual number of business bankruptcies by the number of firm births (business starts)? The following table shows the number of business bankruptcies (1,000s) and the number of firm births (10,000s) for a six-year period.
Business Bankruptcies (1,000s) (y)
34.3
35
38.5
40.1
35.5
37.9
Firm Births (10,000s) (x)
58.1
55.4
57
58.5
57.4
58
DON’T USE R to answer the following questions. You have to show all your work to get full credit. Answers, even if correct, with no justifications will not receive any marks.
a) Write down the unit vector u2 = x−x ̄ ||x−x ̄||
b) Calculate the projection coefficient ⟨y, u2⟩. c) Write down the fitted model in the form
y − y ̄ = ⟨y, u2⟩u2 + residual vector. d) Calculate the terms in the Pythagorean breakup
||y − y ̄||2 = ⟨y, u2⟩2 + ||residual vector||2 and summarize your results in an ANOVA table.
e) Test the hypothesis H0 : β1 = 0 vs Ha : β1 ̸= 0. Assume our errors are independent values from a N(0,σ2) distribution. Use α = 0.05. Provide conclusion explicitly.
STA302 – Fall 2019: Assignment # 1 Page 3 of 3