Inhoud
Computersessie 1: Introduction .................................................................................................... 4
1 Inspect Excel file .......................................................................................................................... 4
2 Import data.................................................................................................................................. 4
3 Transform data ............................................................................................................................ 4
4 Plot Data ...................................................................................................................................... 5
4.1 Time series plot ................................................................................................................... 5
4.2 XY-plot ................................................................................................................................. 6
4.3 Histogram ............................................................................................................................ 6
5 Normality test.............................................................................................................................. 6
6 Descriptive statistics .................................................................................................................... 7
6.1 Mean and variance .............................................................................................................. 7
6.2 Correlations ......................................................................................................................... 8
7 Exercise: “Equity” ........................................................................................................................ 9
Computersessie 2: Classical Linear Regression Model (CLRM) ...................................................... 13
8 Simple regression ...................................................................................................................... 13
8.1 Example: CAPM ................................................................................................................. 13
8.2 OLS-regressie ..................................................................................................................... 13
8.3 Residuals ............................................................................................................................ 15
8.4 R²: goodness of fit strategies ............................................................................................ 16
8.5 Statistical tests................................................................................................................... 17
9 Exercise: “Equity” ...................................................................................................................... 23
10 Multiple regression.................................................................................................................... 31
10.1 OLS estimation of multiple regression .............................................................................. 31
10.2 Residuals ............................................................................................................................ 33
10.3 Detection of outliers.......................................................................................................... 33
10.4 Dealing with outliers.......................................................................................................... 35
11 Regression with dummy variables............................................................................................. 37
Computersessie 3: CLRM Assumptions and Diagnostic Tests ........................................................ 39
12 Pitfalls in regression models using cross-sectional data ........................................................... 39
12.1 Omitted variable basis ....................................................................................................... 39
12.2 Multicollinearity ................................................................................................................ 41
1
,12.3 Omitted variable bias vs. multicollinearity ........................................................................ 43
12.4 Heteroskedasticity ............................................................................................................. 43
13 Working with time series data .................................................................................................. 52
13.1 Example: “Microsoft” ........................................................................................................ 52
13.2 Simple regression model ................................................................................................... 52
13.3 Outliers .............................................................................................................................. 54
14 Pitfalls using time series variables ............................................................................................. 57
14.1 Omitted variable bias ........................................................................................................ 57
14.2 Multicollineariteit .............................................................................................................. 59
14.3 Heteroskedasticiteit .......................................................................................................... 60
15 Additional pitfall: Residual autocorrelation .............................................................................. 63
15.1 Detection ........................................................................................................................... 63
15.2 Example: “badnews” ......................................................................................................... 68
16 Exercises .................................................................................................................................... 75
16.1 Exercise: “Wage discrimination” ....................................................................................... 75
16.2 Exercise: “Earnings” ........................................................................................................... 82
16.3 Exercise: “Philips curve” .................................................................................................... 90
Computersessie 5: Non-Stationarity and Unit Root Testing .......................................................... 95
17 Detecting nonstationary time series ......................................................................................... 95
17.1 Example: “Stock prices on NYSE” ...................................................................................... 95
17.2 Time series plot ................................................................................................................. 95
17.3 Autoregressive model........................................................................................................ 96
17.4 Unit root test ..................................................................................................................... 97
18 Exercise: “Interestrates”.......................................................................................................... 102
Computersessie 7: Models for Panel Data ..................................................................................107
19 Panel data ................................................................................................................................ 107
19.1 Example: “Airline” ........................................................................................................... 107
20 Panel data models ................................................................................................................... 109
20.1 Steps to follow ................................................................................................................. 109
20.2 Pooled OLS: Estimation ................................................................................................... 109
20.3 Individual effects models................................................................................................. 111
21 Exercise: “Panel” ..................................................................................................................... 118
Computersessie 8: Limited Dependent Variable Models .............................................................122
2
,22 Limited dependent variable models (LVD) .............................................................................. 122
22.1 Example: “Split ratings” ................................................................................................... 122
22.2 Linear probability model ................................................................................................. 123
22.3 Logit and probit models .................................................................................................. 125
23 Exercise: “Default”................................................................................................................... 129
3
, Computersessie 1: Introduction
1 Inspect Excel file
• Kijken hoe Excel file is opgesteld
• moeten er transformaties gedaan worden
• wat is eerste kolom/rij
• …
2 Import data
Toolbar: File/Open Data/User File
Save:
Toolbar: File/Save Data
Goed opletten welk type financiële data:
• time series (= var. varieert doorheen tijd)
• cross-sectional (= data over bv. verschillende bedrijven)
• panel (= data doorheen tijd, over verschillende bedrijven)
3 Transform data
(indien nodig!)
Generate new variable:
Toolbar: Add/Define new variable...
Compute return based on total return index (TRI) and define it as R
R = (TRI-TRI(-1))/TRI(-1) (= rendement fortis)
Exercise: Compute market return based on BEL-20 total return index (BEL20) and define it as RM:
RM= (BEL20 -BEL20(-1))/BEL20 (-1)(= rendement markt)
Exercise: Compute return based on price index (PI) and define it as R2.
R2= (PI-PI(-1))/PI(-1) (=rendement prijsindex (PI))
Build in options: log, squares, etc
Select variable(s),
Toolbar: Add/Logs of selected variables
Toolbar: Add/Squares of selected variables
4
Computersessie 1: Introduction .................................................................................................... 4
1 Inspect Excel file .......................................................................................................................... 4
2 Import data.................................................................................................................................. 4
3 Transform data ............................................................................................................................ 4
4 Plot Data ...................................................................................................................................... 5
4.1 Time series plot ................................................................................................................... 5
4.2 XY-plot ................................................................................................................................. 6
4.3 Histogram ............................................................................................................................ 6
5 Normality test.............................................................................................................................. 6
6 Descriptive statistics .................................................................................................................... 7
6.1 Mean and variance .............................................................................................................. 7
6.2 Correlations ......................................................................................................................... 8
7 Exercise: “Equity” ........................................................................................................................ 9
Computersessie 2: Classical Linear Regression Model (CLRM) ...................................................... 13
8 Simple regression ...................................................................................................................... 13
8.1 Example: CAPM ................................................................................................................. 13
8.2 OLS-regressie ..................................................................................................................... 13
8.3 Residuals ............................................................................................................................ 15
8.4 R²: goodness of fit strategies ............................................................................................ 16
8.5 Statistical tests................................................................................................................... 17
9 Exercise: “Equity” ...................................................................................................................... 23
10 Multiple regression.................................................................................................................... 31
10.1 OLS estimation of multiple regression .............................................................................. 31
10.2 Residuals ............................................................................................................................ 33
10.3 Detection of outliers.......................................................................................................... 33
10.4 Dealing with outliers.......................................................................................................... 35
11 Regression with dummy variables............................................................................................. 37
Computersessie 3: CLRM Assumptions and Diagnostic Tests ........................................................ 39
12 Pitfalls in regression models using cross-sectional data ........................................................... 39
12.1 Omitted variable basis ....................................................................................................... 39
12.2 Multicollinearity ................................................................................................................ 41
1
,12.3 Omitted variable bias vs. multicollinearity ........................................................................ 43
12.4 Heteroskedasticity ............................................................................................................. 43
13 Working with time series data .................................................................................................. 52
13.1 Example: “Microsoft” ........................................................................................................ 52
13.2 Simple regression model ................................................................................................... 52
13.3 Outliers .............................................................................................................................. 54
14 Pitfalls using time series variables ............................................................................................. 57
14.1 Omitted variable bias ........................................................................................................ 57
14.2 Multicollineariteit .............................................................................................................. 59
14.3 Heteroskedasticiteit .......................................................................................................... 60
15 Additional pitfall: Residual autocorrelation .............................................................................. 63
15.1 Detection ........................................................................................................................... 63
15.2 Example: “badnews” ......................................................................................................... 68
16 Exercises .................................................................................................................................... 75
16.1 Exercise: “Wage discrimination” ....................................................................................... 75
16.2 Exercise: “Earnings” ........................................................................................................... 82
16.3 Exercise: “Philips curve” .................................................................................................... 90
Computersessie 5: Non-Stationarity and Unit Root Testing .......................................................... 95
17 Detecting nonstationary time series ......................................................................................... 95
17.1 Example: “Stock prices on NYSE” ...................................................................................... 95
17.2 Time series plot ................................................................................................................. 95
17.3 Autoregressive model........................................................................................................ 96
17.4 Unit root test ..................................................................................................................... 97
18 Exercise: “Interestrates”.......................................................................................................... 102
Computersessie 7: Models for Panel Data ..................................................................................107
19 Panel data ................................................................................................................................ 107
19.1 Example: “Airline” ........................................................................................................... 107
20 Panel data models ................................................................................................................... 109
20.1 Steps to follow ................................................................................................................. 109
20.2 Pooled OLS: Estimation ................................................................................................... 109
20.3 Individual effects models................................................................................................. 111
21 Exercise: “Panel” ..................................................................................................................... 118
Computersessie 8: Limited Dependent Variable Models .............................................................122
2
,22 Limited dependent variable models (LVD) .............................................................................. 122
22.1 Example: “Split ratings” ................................................................................................... 122
22.2 Linear probability model ................................................................................................. 123
22.3 Logit and probit models .................................................................................................. 125
23 Exercise: “Default”................................................................................................................... 129
3
, Computersessie 1: Introduction
1 Inspect Excel file
• Kijken hoe Excel file is opgesteld
• moeten er transformaties gedaan worden
• wat is eerste kolom/rij
• …
2 Import data
Toolbar: File/Open Data/User File
Save:
Toolbar: File/Save Data
Goed opletten welk type financiële data:
• time series (= var. varieert doorheen tijd)
• cross-sectional (= data over bv. verschillende bedrijven)
• panel (= data doorheen tijd, over verschillende bedrijven)
3 Transform data
(indien nodig!)
Generate new variable:
Toolbar: Add/Define new variable...
Compute return based on total return index (TRI) and define it as R
R = (TRI-TRI(-1))/TRI(-1) (= rendement fortis)
Exercise: Compute market return based on BEL-20 total return index (BEL20) and define it as RM:
RM= (BEL20 -BEL20(-1))/BEL20 (-1)(= rendement markt)
Exercise: Compute return based on price index (PI) and define it as R2.
R2= (PI-PI(-1))/PI(-1) (=rendement prijsindex (PI))
Build in options: log, squares, etc
Select variable(s),
Toolbar: Add/Logs of selected variables
Toolbar: Add/Squares of selected variables
4