Economics 421/521 - Econometrics - Winter 2011 - Lecture 4 (HD)
Introduction
The instructor introduces the topic of heteroscedasticity and explains that he will be going over some material from the previous lecture.
- Theoretical steps for correcting heteroscedasticity can be confusing, so the instructor will demonstrate how to do it on a computer.
- Students may feel confused at first, but with examples and practice, they should be able to understand the material.
Basic Models of Variance
The instructor discusses four basic models of variance that parameterize it and reduce the number of parameters.
- There are K parameters and one variance for every observation, making it impossible to estimate n+K things with only n pieces of data.
- To solve this issue, we parameterize the variance into a few parameters to write down a model that characterizes every variance at every place time.
- Four basic models of a variance have been discussed so far. One example is Sigma I squared = alpha Sigma squared.
- Model selection is important because if we pick the wrong model, our results will not be accurate.
Parametric Approaches
The instructor explains that parametric approaches are the best way to go if we pick the right model.
- We have a variety of models to capture different ways in which the variance might evolve with data.
- By estimating five things instead of n+K things, we can get all variances using these parametric approaches.
- If we choose the right model, these approaches are flexible and effective.
White's Test and Heteroscedasticity
The section discusses the possibility of P and K not being the same, which requires a flexible functional form called White's test. The goal is to model the variance using either parametric or nonparametric tests for heteroscedasticity.
Modeling Variance
- Rarely does variance depend on something that Y doesn't depend on.
- Use White's test if you don't know the form of the variance.
- Parametrizing the variance will do much better if you have a lot of knowledge about its form.
Three Parameterizations
- Use three parameterizations as the basis for testing heteroscedasticity.
- Estimate a model to get beta 1 hats and u hat.
- Make left-hand side variable over there either Sigma, Sigma square log because this will be entering that square is essentially an estimate of Sigma I squared.
Unbiased Estimates
- If betas are biased, we get a biased estimate of our variance, which is not what we want.
- Estimating unbiased parameters allows us to get an unbiased estimate and consistent estimate of sigma.
Steps
- Estimate models to get estimates for use in regression.
- Run regression to obtain R squared and chi-square statistic for test statistic.
Regression Analysis
The speaker explains how to run a regression analysis and estimate betas using OLS. They also cover how to form the hat matrix and compute the LM test.
Running a Regression Analysis
- To run a regression analysis, use OLS to estimate betas.
- Form the hat matrix by subtracting beta 1 hat minus theta 2 hat Y I and X 2 I minus beta K.
- Use f4u in the program to automatically compute UI hats.
- Compute A, B, and C by squaring the UI hat and regressing it on a constant.
- A is equal to UI hat squared divided by you by hat squared.
- B is equal to the absolute value of U hat I.
- C is equal to the log of U hat squared v.
Computing the LM Test
- Look at the printout for regression A, B, or C depending on which one you want to compute.
- Compute LM test as n times R times R squared where n is number of observations and R squared is on printout.
- Null hypothesis in these problems is alpha 2 equals alpha 3 equals alpha equals 0.
Heteroscedasticity Test
The section discusses the heteroscedasticity test and how to reject or fail to reject the null hypothesis.
Chi-Square Test
- A chi-square test is used to determine if there is heteroscedasticity in a model.
- If the calculated chi-square value is greater than the critical value, we reject the null hypothesis and conclude that there is heteroscedasticity.
- If the calculated chi-square value is less than or equal to the critical value, we fail to reject the null hypothesis and conclude that there is homoscedasticity.
Example Problem
The section provides an example problem on how to estimate a wage equation using log of salary.
Importing Data
- Open a new work file and import an excel file with data on salary and years of experience.
- Check if headers are correct (salary and years), starting from b2, and variables are correctly identified.
- Ensure that data has been imported correctly by checking observations 1 through 222.
Estimating Wage Equation
- Use log of salary as left-hand side variable for more linear relationship.
- Use bullet points to provide a detailed description of key points and insights. Each bullet point is a link to the corresponding part of the video.
Model Specification
In this section, the speaker discusses the model specification for their project and how they plan to test for heteroscedasticity.
Choosing a Model
- The speaker wants to use a model with the equation: beta_0 + beta_1 * years + beta_2 * years^2 + u_t.
- They plan to test for heteroscedasticity using a log sigma i model with the equation: alpha_1 + alpha_2 * years + alpha_3 * years^2.
Forming Variables and Running Regressions
In this section, the speaker forms variables and runs regressions to test their model.
Forming Variables
- The speaker generates two new series of variables: ln_celery (the natural logarithm of celery) and ye_r_ss_q (the square of years).
- They also generate a new series called apps_u_hat which is equal to the absolute value of u_hat.
Running Regressions
- The speaker runs a regression on ln_celery with constant C, years, and years squared as independent variables.
- They save the residuals from this regression in a series called u_hat.
- To avoid losing these residuals when running another regression, they generate a new series called apps_u_hat that contains the absolute values of u_hat.
- They then run another regression on apps_u_hat with constant C, years, and years squared as independent variables.
Understanding the Test Statistic
In this section, the speaker explains what the test statistic is and how to calculate it.
Calculating the Test Statistic
- The test statistic is calculated by multiplying two values together.
- To calculate it, copy a value and multiply it by another value.
- The resulting number is 28.9, which means that we should reject the null hypothesis.
Diagnosing Heteroscedasticity
In this section, the speaker discusses diagnosing heteroscedasticity and how to correct for it.
Graphing U Hat Squared Against Years
- To diagnose heteroscedasticity, graph u hat squared against years using a scatter plot.
- The pattern shows that there is heteroscedasticity in the problem.
- The linear model does not fit well because it expands too slowly compared to the actual pattern.
Using a Nonlinear Model
- A nonlinear model might fit better than a linear model when correcting for heteroscedasticity.
- It's important to choose the right model based on diagnostic tests before making any corrections.
Understanding the Data
The speaker discusses how to interpret statistics and identify trends in data.
Interpreting Statistics
- Statistics are not always obvious, but can be identified through careful analysis.
- A scatter plot of data should be fairly flat with a spread sitting everywhere. Any slope indicates a trend.
- A chi-square table in the back of the book can help determine values for statistical tests.
- Raising a number to 22 times R squared gives an important value for regression analysis.
Analyzing Trends
- Scaling the left-hand axis on a graph can help focus on specific ranges of data.
- Sorting data by magnitude and focusing on initial observations can also help identify trends.
- Changing the sample size in a spreadsheet can provide graphs for specific ranges of data.
Adding a Third Variable
The speaker explains how to add a third variable to regression analysis.
Adding a Third Variable
- Taking the log of Y hat squared creates a third variable for testing.
- This model may be better suited for certain problems, but is not necessary for homework assignments.
Testing Variance with Goldfeld Quant Test
The speaker introduces the Goldfeld Quant Test as a method for testing variance.
Goldfeld Quant Test
- Sigma I squared equals alpha Z I square is used to test variance.
- The Goldfeld Quant Test divides data into three pieces to identify trends.
- The test is based on a particular type of heteroscedasticity that can either grow or narrow down.
Homoscedasticity Test
In this section, the speaker discusses a test for homoscedasticity. The test involves taking the ratio of two variances and comparing it to an F distribution.
Homoscedasticity Test
- The ratio of two independent Chi squares is an F distribution.
- If there's no heteroscedasticity, the ratio should be 1.
- To perform the test, estimate two variances and take their ratio.
- If the ratio is big, reject homoscedasticity.
- If it's small, do not reject homoscedasticity.
Limitations of Homoscedasticity Test
In this section, the speaker discusses some limitations of the homoscedasticity test.
Limitations of Homoscedasticity Test
- This test is not commonly used anymore.
- It relies on a particular type of distribution (Patterson-Sisson).
- It's not robust to distributional problems or non-normal errors.
- There are other tests that are more robust and preferred by many researchers.
Steps for Conducting a Homoscedasticity Test
In this section, the speaker outlines steps for conducting a homoscedasticity test.
Steps for Conducting a Homoscedasticity Test
- Create a spreadsheet with y X2 X3 ... XK from 1 to N.
- Sort your data according to magnitude of some variable (e.g., X3).
- Throw out something in the middle (usually 1/3 to 1/6 of data).
- Copy all variables into a new sheet or spreadsheet for regression analysis.
- If you're very good, you can split the data into two sets and run two regressions.
- Use a single explanatory variable for the variance (e.g., X3).
- Sort your data from small to large or large to small.
- Reject homoscedasticity if the ratio of variances is big, otherwise do not reject it.
Limitations of Single Variable Homoscedasticity Test
In this section, the speaker discusses some limitations of using a single variable for homoscedasticity testing.
Limitations of Single Variable Homoscedasticity Test
- The variance can only depend upon a single variable.
- It's not very useful when there are multiple variables that affect variance.
- It's expensive to use more than one variable in this test.
Regression and Variance
In this section, the speaker explains how to run a regression and estimate variance. They also discuss the importance of keeping as much data as possible.
Running a Regression
- To run a regression, click on the sample button on your regression.
- Change the sample from 1 to 33 and run your regression.
- Keep the estimate of the variance.
- Change the sample from 67 to 104 and run your regression.
- The more data you can keep, the better.
Discarding Useful Information
- It's almost never optimal to discard useful information in a test.
- This test involves discarding things that might help us sort one from another.
- There is probably another test statistic somewhere that's going to dominate this one that doesn't end up throwing away data.
Other Tests
- If you're worried about discarding data, there is another test where you could simply give some data less weight and give others more weight.
- This test is not simple, but it's better than throwing away entirely.
The Gulp Dump On
In this section, the speaker discusses how to identify variables related to variance and divide samples into three parts.
Identifying Variables Related to Variance
- Identify a variable that is suspected positively or negatively related to variance.
- Pick this variable for your model.
Dividing Samples into Three Parts
- Divide your sample into three parts: n1, n2, and n3 (1/6, 2/3).
- Almost always number of observations here are identical.
Calculating F-Statistic
In this section, the speaker explains how to calculate the F-statistic using two RSS values.
Calculating Number of Observations
- The number of observations is calculated by subtracting the starting observation from the ending observation and adding 1.
- For example, if there are 10 observations and we want to use only the first 8, then the number of observations would be 10 - 8 + 1 = 3.
Computing RSS Values
- RSS1 is calculated as the sum of squared residuals for the first regression.
- RSS2 is calculated as the sum of squared residuals for the second regression.
Computing F-Statistic
- The larger RSS value is placed in the numerator and smaller one in denominator.
- The F-statistic is computed as Sigma hat squared2 / Sigma hat squared1.
- Sigma hat squared1 = SS1 / (n-k), where n is number of observations and k is number of independent variables used in regression.
- Sigma hat squared2 = SS2 / (n-n2+1-k), where n2 is number of observations used in second regression.
- The degrees of freedom for numerator are n-n2+1-k and for denominator are n-k.
Understanding Degrees of Freedom
In this section, the speaker explains how degrees of freedom affect statistical tests.
Biased vs Unbiased Estimates
- Sigma squared over n minus k is both consistent and unbiased estimate.
- However, it's biased when using just 'n' instead of 'n-k' in small samples.
Correction Factor
- Correction factor should be applied when sample size is small.
- Ratio n minus k over N approaches infinity or one so correction doesn't matter much with large sample sizes.
Computing F-Statistic
- The F-statistic is distributed as chi-square with degrees of freedom equal to the numerator and denominator.
- The ratio of two independent chi-squares is distributed as F-distribution.
- Degrees of freedom for numerator are n-n2+1-k and for denominator are n-k.
Conducting a Variance Test
In this section, the speaker explains how to conduct a variance test using two regressions.
Picking a Variable
- Pick a variable that you think is related to the variance.
Sorting Data
- Sort data by the chosen variable.
Reordering Cards
- Take your cards and reorder them into three parts.
- Throw out one-third or one-sixth of the observations.
- Run two regressions on early and late observations separately.
Computing F-Ratio
- Compute the F-ratio by dividing larger RSS value by smaller RSS value.
- Place larger RSS value in numerator and smaller one in denominator.
- Degrees of freedom for numerator are n-n2+1-k and for denominator are n-k.
Turn any video into a summary like this
YouTube links, meetings, lectures. With transcripts, search, and chat.