Showing posts with label CFA Level 2 Quantitative Methods Reading 12 Multiple Regression. Show all posts
Showing posts with label CFA Level 2 Quantitative Methods Reading 12 Multiple Regression. Show all posts

Saturday, 29 January 2011

Reading 12.l Qualitative Models & Reading 12.m Economic Meaning

LOS 12.l reads:
“Discuss models with qualitative dependent variables”

It is important to note that to date we have dealt with models that produce QUANTITATIVE dependent variables (e.g. Y). 
An ordinary regression model (e.g everything up to now) is not able to deal with QUALITATIVE dependent variables. 

There are 2 types of models that can deal with qualitative dependent variables
1. Probit & Logits:
 - Probit – Based on the normal distribution
 -  Logit – Based on logistic distribution

These models estimate the likelihood that an event will occur

2. Discriminant models
Similar to Probit & Logit models, but make different assumptions regarding the independent variables.
The model produces a score that produces a Yes or No answer.


LOS 12.m reads:
“ Interpret the economic meaning of the results of the multiple regression analysis and critique the regression model & its results”

This is easy, but important in practice. 
Just because an item is statistically significant does not mean it is economically significant. For example, you might calculate that the share prices rise by 2% in January. If your trading costs are however 3%, it would not make economic sense to buy the shares.

Reading 12,k Model misspecification

The LOS reads:
"Discuss the effects of model misspecification on the results of a regression analysis, and explain how to avoid the common forms of misspecification."

Introduction – What is misspecification?
A model that provides an incorrect description of the data. To some extent all models are misspecified, as no model can consider all potential outcomes. (1) 

The effect of Misspecification
You end up with either biased or inconsistent regression coefficients.
Taking you back to CFA 1, a reminder of biased & inconsistent coefficients.

Bias of an estimator is the difference between this estimator's expected value and the true value of the parameter being estimated. An estimator or decision rule with zero bias is called unbiased. Otherwise the estimator is said to be biased. (2)
A consistent estimator means that the distributions of the estimators become more and more concentrated near the true value of the parameter being estimated, as the sample increases. (2)

The result of biased and inconsistent estimators is unreliable hypothesis testing and inaccurate predictions.


Types of Misspecification

1. The functional form is misspecified
This means in essence that the regression formula is incorrect
There are three types of functional form misspecification, being:

1.1 Important variables are omitted
If road accidents (Y) are caused by speed (X1) and driver skill(X2), omitting speed out of the function will result in misspecification.

1.2 Variables should be transformed
Regression assumes that the Y variable is linearly related to each of the independent variables. (Being Assumption 1) 
The issue is that not variables are often not transformed. Watch out if you are dealing with any variable related to size!
1.3 Incorrect data pooled
Relationships are calculated for a period (e.g 10 years), when the relationship was only applicable for 5 years (but you still include 10 years worth of data).


2. Explanatory variables are correlated with the error term in time series models.

2.1 Using a lagged dependent variables as an Independent variable 








2.2 Forecasting the Future
When you are using information from a period to predict something else from that period 






2.3 Measuring independent variables with error
An example would be when we want to use real interest rates, but we use nominal interest rates.












3. Other time-series misspecifications that result in nonstationary
This is covered in Reading 13.

Reading 12, Types of Errors and Linear Regression

In the previous blogs, heteroskedasticity, serial correlation & multicollinearity were discussed.
These events result in errors as it relates to hypothesis testing. I thought it worthwhile to summarize the types of errors.

Type of violations        Type of Error           Meaning of Error
Heteroskedasticity          Type 1 Error              Rejection of the null hypothesis, when it is true
Serial Correlation            Type 1 Error              Rejection of the null hypothesis, when it is true
Multicollinearity              Type 2 Error              Failure to reject the null hypothesis when it is actually false


Reading 12. j Multicollinearity

The LOS reads:
"Describe multicollinearity, and discuss its causes and effects in regression analysis"


There are 4 areas that appear to be important:
1. What is multicollinearity?
2. What are the effects of multicollinearity?
3. Detecting it
4. How do you correct for it?



1. What is multicollinearity?
In Reading 11 we noted the underlying assumptions of the Linear regression model. Assumptions 2 reads as follows:












For multiple regressions we updated these assumptions, noting that the independent variables are not random and No exact linear relation exists between two or more of the independent variables. Multicollinearity is the exact opposite, being where 2 or more independent variables are highly correlated with 
each other.


2. What are the effects of multicollinearity?
Remember that heteroskadiscity & serial correlation results in standard errors that are too small?
Multicollinearity results in standard errors that are too big.
The result would therefore be the opposite.
Where the first 2 result in t-statistics that are too big, Multicollinearity results in t-statistics that are too small!


3. Detecting it
There is no statistical approach that is required to be studied for the CFA exam.
However, the following is a strong indication:
- Significant F stat, but insignificant t-stat. 
- There is a high correlation between the independent variables. (Usually when one applies your mind to the independent variables it is clear that there is high correlation)


4. Correcting it
The most obvious way is to exclude one of the independent variables from the regression.

Reading 12.i Serial correlation


The LOS reads:
"Discuss the types of heteroskedasticity and the effects of heteroskedasticity and serial correlation on statistical inference"

In the previous blog heteroskedasticity was discussed. 

Similar to the previous blog there are 4 important areas that one should master:
1. What is serial correlation
2. What are the effects of serial correlation
3. Detecting serial correlation
4. How do you correct for serial correlation

1. What is serial correlation?
In Reading 11 and earlier in Reading 12 the underlying assumptions of the Linear Regression Model were discussed. Assumption 5 relates to Serial Correlation:

The summary of the definition was:














Friday, 28 January 2011

Reading 12.i Heteroskedasticity

CFA should give bonus points to those that can spell the word Heteroskedasticity!


The LOS reads:
"Discuss the types of heteroskedasticity and the effects of heteroskedasticity and serial correlation on statistical inference"


There are 4 areas that appear to be important:
1. What is heteroskedasticity
2. What are the effects of heteroskedasticity
3. Detecting heteroskedasticity
4. How do you correct for heteroskedasticity


1. What is heteroskedasticity?
In Reading 11 & earlier in Reading 12 the underlying assumptions of the Linear Regression Model were discussed. Assumption 4 relates to Homoscedasticity, being the opposite of Heteroskedasticity.


The summary of the definition was:













(NB - Remember that Error term also refers to the Residual)

CFA Level 2, Reading 12.h, Dummy variables

I guess what makes CFA difficult is the fact that one also have other responsibilities!
2 weeks with little progress. Not good. Any way..



The LOS reads:
h. formulate a multiple regression equation by using dummy variables to represent qualitative factors, and interpret the coefficients and regression results


What is a dummy variable?
A dummy variable is one that takes the values 0 or 1 to indicate the absence or presence of some categorical effect that may be expected to shift the outcome. 
For example, in econometric time series analysis, dummy variables may be used to indicate the occurrence of wars, or major strikes. It could thus be thought of as a truth value represented as a numerical value 0 or 1. (1)
(This reminds me a lot of using 0 or 1 to do computer programming at the machine level.) 

Tuesday, 11 January 2011

CFA Level 2, Reading 12.f, Adjusted R Square

The LOS reads:
f. distinguish between and interpret the R Square and adjusted R Square in multiple regression.

R square
R square measures the fraction of the total variation in the dependent variable that is explained by the independent variable. This was discussed in Reading 11.

The formula for R square as defined in Reading 11 is:
= 1 minus Unexplained variation
                    Total variation

(NB – Note in previous blog how the regression tables are used to obtain “Unexplained Variation & Total Variation”)

The problem with R square is that one can increase R square simply by including many additional independent variables that explain even a slight amount of the previously unexplained variation, even if the amount they explain is not statistically significant. 


Solution! 

Monday, 10 January 2011

CFA Level 2, Reading 12.e, F-statistic

CFA Level 2, Reading 12.e, F-statistic

The LOS reads as follows:
e. calculate and interpret the F-statistic, and discuss how it is used in regression analysis

Discuss how it is used in regression analysis
The use of the F statistic has already been discussed in Reading 11, 3.6. The difference between Reading 11 and Reading 12 relates to the number of independent variables.

We use the t-test to determine whether the coefficients are equal to 0. If none of the independent variables in a regression model helps explain the dependent variable, the slope coefficients should all equal 0.

In a multiple regression, however, we cannot test the null hypothesis that all slope coefficients equal 0 based on t-tests that each individual slope coefficient equals 0, because the individual tests do not account for the effects of interactions among the independent variables. We therefore use the F-statistic.

Calculate the F-statistic
For one independent variable the formula for the F statistic is as follows:





But remember, Reading 12 deals with multiple independent variables. The formula is therefore:







where k = number of slope coefficients

In a previous post, we used data from BHP and the excel function to create a ANOVA table. The output was  as follows:
Using the F-statistic, we are able to reconstruct how F (0.881045325) was calculated.
RSS = 101.240
SSE = 114.909
k = 2
n = 5

Therefore;
(101.240/2) / (114.909/(5-(2+1))
50.620 / 57.454
= 0.88104

Interpret the F-statistic
Remember that we are using the F-statistic to determine whether the slope coefficients equal 0. To do that we need a significance level and need to compare the calculated F-statistic to the tables.
Lets assume that the level of significance is 0.05
WE ALWAYS USE A ONE SIDED TEST AS THE MSR NECESSARILY INCREASES RELATIVE TO MSE AS THE EXPLANATORY POWER OF THE REGRESSION INCREASES

So, on the F-statistic table, with 2df in the Numerator & 2df in the Denominator, we note a value of 19.
This indicates that we can accept the null hypothesis and that all the slope coefficients equal 0.
The independent variables therefore DO NOT help explain the dependent variable.


The table also provides a “Significance F,” p-value of 0.53. This p-value means that the smallest level of significance at which the null hypothesis can be rejected is 0.53.
The small value for this F-statistic implies a high probability of incorrectly rejecting the null hypothesis (a mistake known as a Type I error).

Friday, 31 December 2010

CFA Level 2, Reading 12.d) Assumptions of Multiple Regression

CFA Level 2, Volume 1, Quantitative methods, Reading 12, Multiple Regression
(References refer to CFA text book)



LOS 12.d) Explain the assumptions of a multiple regression model


The assumptions of the Multiple Regression model is very much the same as that of the classical normal linear regression model. Also see the link to post to memorize these assumptions.
The differences are noted in RED.


Multiple Regression Model Assumptions
1. The relationship between the dependent variable, Y, and the independent variable, X is linear in the parameters b0 and b1.

1. The relationship between the dependent variable, Y, and the independent variables is linear.
2. The independent variable, X, is not random.


2. The independent variables are not random.
No exact linear relation exists between two or more of the independent variables.
3. The expected value of the error term is 0: E(℮) = 0.


3. The expected value of the error term, conditioned on the independent variables, is 0

4. The variance of the error term is the same for all observations. (also called Homoscedasticity)



4. The variance of the error term is the same for all observations. (also called Homoscedasticity)

5. The error term, ℮, is uncorrelated across observations. Consequently,
E(℮i, ℮j) = 0 for all i not equal to j



5. The error term, ℮, is uncorrelated across observations. Consequently,
E(℮i, ℮j) = 0 for all i not equal to j

6. The error term, ℮, is normally distributed.


6. The error term is normally distributed

Sources
1. www.duke.edu/~rnau/testing.htm
2. Wikipedia.org/wiki/forecast_bias

Reading 12, Learning outcomes a) to c)

Level 2, Volume 1, Quantitative Methods, Reading 12, Multiple Regression
The references refer to the CFA text book.


LOS 12 a) to c) is fairly integrated, but is fairly straight forward if one understands the principles of Reading 11. These are discussed in an example from a previous blog.
The regression statistics, noted below, are used to illustrate the learning outcomes.
(Included a link to a blog explaining how to set up Excel to create your own regression tables.)



a.1) formulate a multiple regression equation to describe the relation between a dependent variable and several independent variables
The multiple regression equation is similar to that for an equation using only one independent variable.
The only differences is that the instead of one independent variable there are more than one,
being b1X1i + b2X2i etc.





In the BHP example above the dependent variable is the BHP share price, with two independent variables being selected, being Revenue US$ per share and Net Operating cashflow per share. (There is a strong argument to be made that these two measures have a linear relationship, contravening one of the assumptions of the model. This is for now ignored.)

The Coefficients from the Summary output indicates the following:
Intercept =                                    27.321
Revenue US $m per share =            -4.269
Net operating cashflow per share = 15.828

The multiple regression equation is therefore:
Y = 27.321 -4.269(X1) + 15.828(X2)

a.2) determine the statistical significance of each independent variable
As you might recall a result is called statistically significant if it is unlikely to have occurred by chance.

It is suggested that one first consider the overall significance of the regression, before considering the coefficients.
This is done by reviewing the F score and Significance F.

The entry of 0.51 for the significance of F means that the regression is significant at the 0.51 level.
This implies that there is a high likelihood that the result occurred by chance.

Although it is suggested that one does not proceed (as the F score already suggested that the event occurred by chance) the individual coefficients also support the F score conclusion.
The t-statistic is used to determine the statistical significance.

a.3) interpret the estimated coefficients and their p-values.
The t-statistic for the coefficients are relatively low, suggesting that it is highly likely that the null hypothesis will be accepted. To evaluate the significance of the t-statistic we need to determine a quantity called degrees of freedom. This has been discussed in previous readings.

The p-values provide one with level of significance at which the null hypothesis will be rejected. It has the benefit that it gives the reader to decide whether he or she is willing to accept the level of significance. A level of 95% (and a p value of 0.05) is generally accepted as the norm.
You will note that the p-values for the coefficients are all in excess of 0.33, indicating a great likelihood that the results are by chance.

b.1) formulate a null and an alternative hypothesis about the population value of a regression coefficient
H0: b1X1 = 0
Ha: b1X1 <>0

AND
H0: b2X2 = 0
Ha: b2X2 <>0

Using a two tailed test!

b.2) calculate the value of the test statistic 
We will assume that we are testing at 95% level, for a two tailed test.
Therefore, with a df of 2 (5 Observations – 3), using the tables, we obtain a value of 4.303.

b.3) determine whether to reject the null hypothesis at a given level of significance by using a one-tailed or two-tailed test
The test statistic has been calculated as 4.303.
To accept the null hypothesis, the t stat should be less than 4.303 or -4.303.
All the coefficients fit into this range, indicating that we can accept the null hypothesis.

b.4) interpret the results of the test
At a 95% level we can not accept that the results are not the result of chance.

c.1) calculate and interpret a confidence interval for the population value of a regression coefficient and
The output has already calculated this. Specifically for the Net operating cashflow per share, at the 95% level, it has been calculated as -39.189 to 70.845.

This interval level is derived as follows:
15.828 +/- (4.303)(12.797) = -39.189 and 70.845

c.2) calculate and interpret a predicted value for the dependent variable, given an estimated regression model and assumed values for the independent variables.
We make use of the estimated regression model, being
Y = 27.321 -4.269(X1) + 15.828(X2)

Let’s assume that revenue per share will increase by 10% on 2010 numbers ($10.44), and net cash flow per share by 20% ($3.86).
Using this, the formula will be
Y = 27.321 -4.269(10.44) + 15.828(3.86)
Y = 43.84 predicted value for the share price.

It is VERY IMPORTANT TO REMEMBER THAT THE MODEL IS BUILD ON THE ASSUMPTION THAT THE SECOND INDEPENDENT VARIALBE REMAINS CONSTANT

In the reading on correlation and regression, we presented procedures for constructing a prediction interval for linear regression with one independent variable.
For multiple regression, however, computing a prediction interval to properly incorporate both types of uncertainty requires matrix algebra, which is outside the scope of this reading.

Wednesday, 29 December 2010

Reading 12 - Using Excel to create Regression Tables

Level 2, Quantitative Methods, Reading 12

Reading 11 & Reading 12 refer to Regression tables on a regular basis. 
A regression table for one independent variable was analysed in this post. 

These tables are produced by most statistical packages, including Microsoft Excel 2007.
Included below are the steps to enable you to generate your own regression tables using Excel.
This is pretty useful if you want to apply the learnings of the Reading to real examples
(Based on the following webpage & my own work. http://mtsu32.mtsu.edu:11308/regression/level3/multireg/useexcel.htm)

1. Click the "Ribbon", top left corner
2. Select Ëxcel Options"
3. Select "Add-Ins"
4.  Select "Analysis ToolPak" 
5. Select "Go"
6. Tick the "Analysis ToolPak"
7. Select ''OK"

The Analysis ToolPak is now installed, and it everything worked as planned you will not need to repeat these steps.
8. Go to the Data tab
9. Select "Data Analysis"
10. Select "Regression" and select "OK"
11. Complete the input screen with relevant data, specifically:
11.1 Input Y range: This is the dependent variable
11.2 Input X range: Here you can select only one range, or more, if multiple regression is calculated
11.3 Select "Labels" and the Confidence level (this is optional)
11.4 Select your output preferences.

























There you go!



Cheers!