Lecture notes 1 (Two variable regression) Flashcards
How do you calculate correlation?
What is a feature about it?
COV(X,Y) / sqrt V(X) V(Y)
It is scale free.
What is correlation?
The systematic relationship between two variables?
How do you calculate Covariance of X,Y
Show both methods
Sum of (xi- xbar)(yi-ybar) / n-1
E(y-meany)(x-meanx)
When can we view correlation as a causal relationship? (in context)
In clinical trials when you randomly assign different people to different groups.
What two components is this made of yi = α + βxi + εi ?
yi = α + βxi + εi
yi = α + βxi (systematic part)
εi is random
What are the 4 Classical Linear Regression assumptions in a model like:
yi = α + βxi + εi
- E(εi | xi) = E(εi) = 0 ∀i (so the error term is independent of xi).
- V (εi | xi) = σ^2 ∀i (error variance is constant (homoscedastic) – points are distributed around the true regression line with a constant spread)
- cov(εi, εj |xi) = 0 for i ̸= j (the errors are serially uncorrelated over observations)
- εi | xi ∼ N(0, σ^2) ∀i
How can we interpret something as a causal effect?
If E(εi | xi) = 0
What is the CLRM assumption of homoscadascity?
That all error terms must have a constant variance for every different explanatory variable value.
What does this CLRM assumption mean cov(εi, εj |xi) = 0 for i ̸= j
It shows the information about the ith person cannot predict the jth person.
Knowing the epsilon of person i will not help in predicting person j
What does the CLRM assumption mean εi | xi ∼ N(0, σ^2) ∀i
-The error terms take on a normal distribution
-Purely for mathematical convenience.
What does the CLRM assumption mean
E(εi | xi) = E(εi) = 0 ∀i
for every value of x the mean of epsilon is 0
The error terms are indepedent of x
When estimating a simple regression line for alpha, beta and standard deviation what are the estimates?
Alpha = a
Beta = b
Stdv = s^2
How does the OLS estimation work?
yi = α + βxi + εi
yi is real value
yhat is predicted value
for OLS you want to minimise difference between real and predicted value by choosing a and b.
-Add sqaured differences of each observation and minimise it.
-Optimal solution is to minimise the residuals sum of sqaures.
What is e?
e is the observed residual difference between yi and yhat
When using OLS graphically what are we doing?
We are looking at a perfect straight line then looking at how far actual data point is from straight line.
Square all these differences and then minimise them.
This would then find the straight line that is closest to all data points.