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

Problem Set 2

ECON 306 - Introduction to Econometrics

Spring 2022

 

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

 

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 in a .pdf file, 2) any figures (scatterplots, histograms, etc.), and 3) any written explanations and answers.  All of these components need to be attached together in that order.  Late submissions will NOT be ac- cepted. 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.

Earnings and Height.xlsx Data.

The Earnings and Height.xlsx data are taken from the US National Health Interview Survey for 1994. They are a subset of the data used in Anne Case and Christina Paxson’s paper “Stature and Status: Height, Ability, and Labor Market Outcomes,” Journal of Po- litical Economy, 2008, 116(3):  499-532, and were graciously supplied by the authors.The dataset contains information on 17,870 workers. There is an additional PDF file on Canvas that describes the variables.

Use the data to complete the following:

Problem 1. The data is currently in an Excel format. You need to import it into Stata and convert it into a Stata dataset (.dta). To do that, you can either 1) in Stata, go to ‘File’, then ‘Import’, ‘Excel spreadsheet.’  Then, carefully, read the options Stata offers you as to how to import the Excel data exactly. You do not want your data to be imported as strings; or) you can directly type up the command ‘import excel’ in Stata (of course, first type ‘help import excel’ to check the syntax of the command and the options it provides).  Once you have the data imported in Stata (YAY!), save it as ‘ErngsHght.dta’ .

Problem 2. What is the median value of height in the sample? (You should not do any calculations. Stata will do them for you. You need to just type up 1 command.)

Problem 3. Run a regression of Earnings on Height.

a) What is the estimated slope?

b) Use the estimated regression to predict earnings for a worker who is 67 inches tall, for a worker who is 70 inches tall, and for a worker who is 65 inches tall. You do not have to do any coding in Stata to answer this question.  Just calculate the predicted value of earnings for a worker who is 67 inches tall, for a worker who is 70 inches tall, and for a worker who is 65 inches tall.

c) Is the estimated slope statistically significant. Construct a 95% confidence interval for the slope coefficient.  You do not have to do any coding in Stata to answer this question. Stata has already reported the confidence interval, you need to just interpret it.

Problem 4. Run a regression of Earnings on Height for female workers only. You can achieve this using an “if” statement after the “regress” command.

a) What is the estimated slope?

b) A randomly selected woman is 1 inch taller than the average woman in the sample. Would you predict her earnings to be higher or lower than the average earnings of women in the sample. By how much?

Problem 5.  Run a regression of Earnings on Height for male workers only.  You can achieve this using an “if” statement after the “regress” command.

a) What is the estimated slope?

b) A randomly selected man is 1 inch taller than the average man in the sample. Would you predict his earnings to be higher or lower than the average earnings of men in the sample. By how much?

Problem 6. Construct a scatterplot of annual earnings on height. Notice that the points on the plot fall along horizontal lines. (There are only 23 distinct values of Earnings). Why? Hint:  Check the data description documentation I have provided for this assignment. The answer to this question has to do with the raw data.