20.06.2024 Test Exam#

Example Regression#

How to do a regression by hand:

Given Values:

y = testscore

89

71

69

58

42

55

x = time

6

8

4

6

14

12

  1. \(\bar{ x }\): 25/3

  2. \(\bar{ y }\): 64

  3. \(\sum_{i=1}^n x_i^2\) = 492

  4. \(\sum_{i=1}^n x_i y_i\) = 2974

A: \(b_1\)#

\[\begin{split} \hat{\beta_1} = \frac {\widehat{Cov}_{xy}} {\widehat{Var}_x} = \frac {\sum x_i y_i - n \bar{ x } \bar{ y }} {\sum x_i^2-n \bar{ x }^2} \\ = \frac{ 2974-6*64*25/3 }{492-6*(25/3)^2} \\ = \frac{ -226 }{226/3} = -3 \end{split}\]

B: \(b_0\)#

\[\begin{split} \beta_0 =(\bar{y}- \hat{\beta_1} \bar{x}) \\ = (64-(-3)\frac{ 25 }{3}) = 89 \end{split}\]

Formel: \(y = 89-3*x\)

C: \(R^2\)​​#

  • calculate fitted values

  • calculate residuals

1

2

3

4

5

6

\(\hat{ y }\)

71

65

77

71

47

53

u

18

6

-8

-13

-5

2

  • \(\sum u = 0\) !!!

  • \(\sum u^2 = 622\)

  • \(\sum y_i^2 = 25876\)

\[\begin{split} R^2 = 1-\frac{ \sum \hat{ u }^2 }{\sum y_i^2- n*\bar{ y }^2} \\ =1- \frac{ 622 }{25876-6*64^2} = 0.5215 \end{split}\]

D: \(Std. Error: Regression\)#

\[\begin{split} \hat{ \sigma }^2 = \frac{ 1 }{n-2} * \sum_{i=1}^n \hat{ u }^2 \\ = 1/4*622 = 155.5 \\ \hat{ \sigma } = \sqrt{ \sigma^2 } = 12.4600 \end{split}\]

E: \(Std. Error: \beta_1\)#

\[\begin{split} se(\beta_1) = \frac{ \sigma^2 }{\sqrt{SST_x}} \\ SST= \sum (x-\bar{ x })^2 \end{split}\]

1

2

3

4

5

6

\((x-\hat{ x })^2\)

ToDo#

  • Normale Regression berechnen

    • SE der Regression

    • SE von einem Koeffizienten

  • R^2 aus R-Ergebnissen berechnen (7.4)

  • Konfidenzintervall (7.3)

  • Hypothesen und Test

    • t-Verteilung

    • Normalverteilung

  • partielle Effekte

  • Marginal Effekte

  • R-Code anschauen

  • Percentage / percentage Points