Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Problem Set 1

ECON 306 - Introduction to Econometrics

Spring 2022

 

INSTRUCTIONS: Solve the following questions to the best of your ability.  Come see me and ask me if you do not know how to solve any of these questions, even before the due date. I will work with you if you are having trouble solving these.

 

This is an optional, extra-credit assignment.  To receive full credit for this assignment, the problem set needs to be submitted to Canvas in a single PDF document containing your 1) Stata log file, 2) any figures (scatterplots, histograms, etc.), and 3) any written explana- tions and answers. All of these components need to be attached together in that order. Late submissions will NOT be accepted.  DO NOT email!  No assignments will be accepted via email.



First of all, for this problem set, you will have to submit the Stata log file.  Stata can record your session into a file called a log file but does not start a log automatically; you must tell Stata to record your session.  By default, the resulting log file contains what you type and what Stata produces in response, recorded in a format called Stata Markup and Control Language  (SMCL). The file can be printed or converted to plain text for incorporation into documents you create with your word processor. You can find more information here: https://www.stata.com/manuals13/u15.pdf.

So, in the beginning of your Stata .do file write the following command: log using PSX, replace (or a different file name). Then, at the very end of your .do file, include log close and then on a new line translate PSX.smcl PSX.pdf. This would translate your Stata SMCL log files directly into PDF files and then use Adobe Acrobat to merge PDF files together. You will need to turn in this log file to receive full credit for this assignment.

I would strongly suggest compiling the log file in Stata after you have completed all of your code and can run it smoothly without any errors.  In that way, your log file would not contain any lines of code that do not produce any results or any duplicate results. Please do your best to include comments in your code (using the ∗ sign in your Stata .do file) and to make the solutions to the different problems as clearly marked as possible. Otherwise, the graders might have to penalize you, if they cannot follow your work.  And then I will have to re-grade your work and the whole process becomes highly inefficient.

 

Part I - CPS96 15 Data.

Each month the Bureau of Labor Statistics in the U.S. Department of Labor conducts the “Current Population Survey” (CPS), which provides data on labor force characteristics of the population, including the level of employment, unemployment, and earnings. Approximately 54,000 randomly selected U.S. households are surveyed each month. The sample is chosen by randomly selecting addresses from a database comprised of addresses from the most recent decennial census augmented with data on new housing units constructed after the last census. The exact random sampling scheme is rather complicated (first small geographical areas are randomly selected, then housing units within these areas randomly selected); details can be found in the Handbook of Labor Statistics and is described on the Bureau of Labor Statistics

website.

The survey conducted each March is more detailed than in other months and asks ques- tions about earnings during the previous year. The file CPS96 15 contains the data for 1996 and 2015 (from the March 1997 and 2016 surveys).  These data are for full-time workers, defined as workers employed more than 35 hours per week for at least 48 weeks in the pre- vious year.  Data are provided for workers whose highest educational achievement is (1) a high school diploma, and (2) a bachelor’s degree.

Below you can find a brief description of the variables:

❼ FEMALE: 1 if female; 0 if male

❼ YEAR: Year

❼ AHE: Average Hourly Earnings

❼ BACHELOR: 1 if worker has a bachelor’s degree; 0 if worker has a high school degree

❼ AGE: Age of the worker

Use the data CPS96 15.xlsx to complete the following:



Problem  1.  Now, we have the individual’s average hourly earnings for two different years - 1996 and 2015.   Obviously, during that time period, prices in the economy have changed.  So, we need to adjust the AHE variable for inflation using the Consumer Price Index (CPI). In 2015, CPI was 237, while in 1996 CPI was 156.9. Adjust the AHE variable in Stata for the price inflation that occurred between 1996 and 2015.  Here are some steps I would take to do that:  1) create a new variable (AHE15, for instance) that is equal to AHE for 2015; 2) if the year is not 2015 (but 1996), replace the values of the new variable (AHE15) with the values of AHE divided by the CPI for 1996 and multiplied by the CPI for 2015.

Problem 2.  Report the sample mean for average hourly earnings (AHE) in 1996 and 2015 after adjusting for inflation.  (You should not do any calculations by hand!  Stata will do them for you. You need to just type up 1 line of commands.)

Problem  3.   Table 3.1 in the textbook presents information on the gender pay gap for college students.  Prepare a similar table for high school graduates, using the 1996 and 2015 data. You would not be able to easily construct the table in Stata.  Instead, prepare the table in Word or Excel, using the statistics calculated in Stata.  Are there any notable differences between the results for high school and college graduates? You need to create a table in the same format as Table 3.1 from the book, but for high-school graduates.

Problem  4.   In Stata, use the appropriate estimates, confidence intervals, and test statistics, to answer the questions below.

a) Construct a 95% confidence interval for the mean of AHE for high school graduates, using the data for 2015.  Then, do the same using the data for 1996.  (You should not do any calculations by hand!  Stata will do them for you.  You need to just type up 1 line of commands.)

b) Construct a 95% confidence interval for the mean of AHE for college graduates, using the data for 2015.  Then, do the same using the data for 1996.  (You should not do any calculations by hand!   Stata will do them for you.   You need to just type up  1 line of commands.)

 

Part II - Birthweight Smoking.xlsx Data.

The Birthweight Smoking.xlsx dataset is from the 1989 linked National Natality- Mortality Detail files, which contains a census of infant births and deaths. The data are for births in Pennsylvania in 1989.  These data were provided by Professors Douglas Almond, Kenneth Chay, and David Lee and are a subset of the data used in their paper “The Costs of Low Birth Weight,” Quarterly Journal of Economics, August 2005, 120(3): 1031-1083.

Use the data to complete the following:

Problem 1. In the sample,

a) What is the average value of Birthweight for all mothers?

b) What is the average value of Birthweight for all mothers who smoke?

c) What is the average value of Birthweight for all mothers who do not smoke?

Problem 2. Use the data to estimate the difference in average birth weight for smoking and non-smoking mothers.

a) What is the standard error for the estimated difference?

b) Construct a 95% confidence interval for the difference in the average birth weight for smoking and non-smoking mothers.

Problem 3. Run a regression of Birthweight on the binary variable Smoker.

a) Explain how the estimated slope and intercept are related to your answers in Problem

1 and Problem 2.

b) Explain how the SE(βˆ1) is related to your answer in Problem 2.

c) Construct a 95% confidence interval for the effect of smoking on birth weight.

Problem 4.  Do you think that smoking is uncorrelated with other factors that cause low birth weight?  That is, do you think that the regression error term has a conditional mean of 0 given Smoking (Xi)?

 

Part III - CPS2.dta Data.

Each month the Bureau of Labor Statistics in the U.S. Department of Labor conducts the “Current Population Survey” (CPS), which provides data on labor force characteristics of the population, including the level of employment, unemployment, and earnings. Approximately 60,000 randomly selected U.S. households are surveyed each month. The sample is chosen by randomly selecting addresses from a database comprised of addresses from the most recent decennial census augmented with data on new housing units constructed after the last census. The exact random sampling scheme is rather complicated (first small geographical areas are randomly selected, then housing units within these areas randomly selected); details can be found in the Handbook of Labor Statistics and is described on the Bureau of Labor Statistics

website (www.bls.gov).

The survey conducted each March is more detailed than in other months and asks ques- tions about earnings during the previous year. These data are from the March 2016 survey.

Use the CPS2.dta data to complete the following:

Problem 1.  First, examine what are the mean average hourly earnings and the mean level of education in the sample.  Then, estimate a regression of Average Hourly Earnings on Years of Education.

Problem 2. Next, compute regression residuals.  (Hint: There is a very neat command in Stata that would do that for you.)

Problem 3. Can you illustrate the conditional mean assumption by creating a histogram of the regression residuals on Stata?   Let the title of the histogram be  “Distribution of Regression Residuals - All Education Levels.”

Problem 4. Lastly, create a second histogram of the regression residuals now for college graduates only.  Let the tile of this histogram be  “Distribution of Regression Residuals - College Degree.”

 

Part IV- CPS2.dta Data.

Stata is a wonderful programming language mostly due to its numerous built-in com- mands.  For example, we can calculate the correlation between Average Hourly Earnings and  Years of Education by simply typing  “correlate ahe yrseduc” or their covariance by adding “correlate ahe yrseduc, cov.” To make coding a bit more interesting for you, I would like you to create a piece of code that computes the correlation and covariance between Av- erage Hourly Earnings and Years of Education (using the dataset from Part III - CPS2.dta Data.) without actually using the “correlate” command in Stata. That is, write a code that computes the correlation and covarance between these variables (Average Hourly Earnings and Years of Education) using the formulas for correlation and covariance that you are already familiar with. Do this step by step, starting by the smaller parts of the formulas that you need to compute. For instance, first create a variable that is equal to the average value of Average Hourly Earnings. Then, demean Average Hourly Earnings by subtracting the mean from each observation in the variable Average Hourly Earnings. Do the same for Years of Education and proceed forward.

Again, this exercise is intended to give you more practice with coding on Stata. It is not that scary, I promise. The code that I have written as a solution to this problem is literally 14 lines long. Give it your best shot! And try to have fun with it!

Finally, here are some commands that I have used in my code and would suggest you explore in Stata: egen, generate, replace.