Linear Regression Flashcards
1
Q
When to use linear Regression?
A
If knowing the correlation isn´t enough. We want to find out more about the relation.
2
Q
How to calculate linear regression using least square method?
A
- Calculate mean of x and y. This is the point where the linear regression line has to get through. p.e. (3/4)
- Take the simple linear regression equation
ŷ = b0 + b1*x to calculate the slope (b1). The formula is Sum(x-xmean)(y-ymean) / Sum(x-xmean)**2 - calculate the y-intercept by taking the x/y mean point from the beginning, in this case (3/4), and put it in the regression equation to easily find b0.
- State the final regression equation for that case by fillin in slope and intercept. p.e. ŷ=1.6+0.7x
3
Q
What is the simple linear regression equation?
A
ŷ = b0 + b1*x
ŷ=the predicted value of y (the dependent variable) in a regression equation.
b1=slope
b0= y-intercept
4
Q
What does R-squared tell us?
A
How well a regression line actually predicts the values 1.0 would be the perfect prediction.
5
Q
How to calculate R-squared?
A
- Take the linear regression equation (with intercept and slope calculated) at hand. P.e. it could be ŷ=1.6+0.7x
- Put in the x values of your points in the equation and calculate ŷ.
- Now put everythin in the formula of R-squared
Sum(ŷ-ymean)2
______________
Sum (y-ymean)2