11/7/2018 Assignment 2 preview | Crowdmark
This is a preview of what students will see when they are submitting the assignment. Interactive features are disabled.
Assignment 2
Due: Monday November 26, 2018 1:00 PM (Eastern Standard Time)
Assignment description
Reminders from the syllabus:
Late assignments have 10% per day deducted and those that are more than 48 hours late receive a grade of zero.
Turnitin software may be used to assess similarities among assignments.
Assignments aren’t to be discussed in office hours with TAs or the instructor. (Also see Q4 below.)
Further instructions:
Show your work, including all R code used. It is very helpful to comment your lines of R code individually.
There are 20 marks available (plus two optional bonus marks). Use as needed.
https://app.crowdmark.com/assignments/assignment-2-f625a/preview
1/3
50.0 = α
11/7/2018 Assignment 2 preview | Crowdmark
Background to question 1: This month, U of T marks the centenary of the Armistice, an event whose calamitous aftermath was described by alumna Prof Margaret MacMillan (above), among others.
In later work, Harvard professor Erica Chenoweth and others used statistical methods to show how nonviolence is strategically superior to violence. She has shared with our STA302 class a dataset regarding nonviolent campaigns up to 2006. After some editing by your instructor it contains:
Predictor , the population of a location on Earth
Response , the peak membership in a successful or partly successful nonviolent campaign
The units for and are: number of persons. The data are here, and you can load them in R using read.csv(“A2.csv”,sep=”,”) or similar.
Submit your assignment Help Q1 (16 points)
Below is the SLR flowchart on page 103 of our textbook, each step labelled with a letter (A through P) for ease of reference:
https://app.crowdmark.com/assignments/assignment-2-f625a/preview
2/3
yx
y x
11/7/2018 Assignment 2 preview | Crowdmark
Apply this flowchart to A2.csv. At each stage in your work, identify which part of the flowchart you’re in (for example, using headings). The question you seek to answer is whether there may exist a relationship between the predictor and the response variable. If you suspect a relationship, state it as an expression. Hints:
If you encounter step G or L, you may ignore it and continue to J or M respectively.
If you encounter step F then you may answer the question, or simply recall from class that an alternative to deciding whether interesting points are valid is to later report results with and without them.
Q2(a) (3 points)
You have a dataset for which SLR under the Gauss-Markov conditions is appropriate. You’re given sigma2, the variance of the model error term, and x, a vector of predictor variables. Write R code to find and from the lectures, and thence the covariance matrix of the residuals. Save your answer as an R matrix named V. Hint:
The diag command produces an identity matrix. Q2(b) (1 point)
Use your work from Q2(a) to calculate V for sigma2=2 and x=seq(1,4). Q3-BONUS (2 points)
Preamble: This challenge question is optional and you can achieve 20/20 on the assignment without doing it. The bonus given will generally be 0 or 2. Your two assignments can’t collectively contribute more than 10 percentage points to your final grade.
Derive an equation for the maximum number of leverage points possible in a dataset of size . Show your workings/thoughts, using equations/sentences to describe what a dataset would look like in order to reach this maximum. Your answer will be in terms of only — don’t include in your final expression other variables such as values, values etc. Hints:
You may use floor/ceiling notation if needed: or
Don’t assume that the data were generated according to any of our commonly used assumptions (Gauss-Markov conditions, etc).
Names (0 points)
If you worked with other students on this assignment then indicate the names of the students here. Your solutions must be written up independently (i.e., your solutions should not be the same as another student’s solutions).
https://app.crowdmark.com/assignments/assignment-2-f625a/preview
3/3
n
n
⌉⌈ ⌋⌊ yx
nHX n