Econometrics lab Econometrics 322 Lab #4a Basic OLS Regression Prof. Paczkowski Contents¶ Collaboration Policy IntroductionPurpose Problem Assignment DocumentationAbstract Data Dictionary Tasks...

http://localhost:8888/notebooks/Econometrics%20lab.ipynb#


Econometrics lab Econometrics 322 Lab #4a Basic OLS Regression Prof. Paczkowski Contents¶ Collaboration Policy IntroductionPurpose Problem Assignment DocumentationAbstract Data Dictionary Tasks Collaboration Policy¶ Back to Contents Study groups are allowed but I expect students to understand and complete their own assignments. Just like all other classes at Rutgers, the Rutgers' Honor Pledge is taken seriously. Introduction¶ Back to Contents Purpose¶ Back to Contents This lab will introduce you to doing a simple OLS estimation using Statsmodels. At the end of this lab, you will be able to: run an OLS estimation; retrieve some basic OLS relevant data. Answer the questions in your own words. You will NOT submit these answers. What you answer below is for your own study. You will, however, be quizzed on what you did and learned in this lab. The quiz will be made available on Canvas later. Problem¶ Back to Contents This is a repeat of the water consumption problem discussed in class. What determnines the demand for bottled water? Assignment¶ Back to Contents Use the water consumption data to estimate a simple regression model. The water consumption data was introduced at the beginning of the semester and is available on Canvas in the file lab4.csv. The purpose of this lab is simply to have you become familiar with estimating a regression model in Python. Documentation¶ Back to Contents Abstract¶ Back to Contents Write a well-crafted paragraph summarizing what you learned about the problem. Do not write that you learned how to use Jupyter. Write only about the problem. Do this AFTER you complete the lab assignment. Enter your Abstract in this cell Data Dictionary¶ Back to Contents See Lecture 2 discussion about this data. VariableValuesSourceMnemonic Year of ObservationNominal, annual 1993 - 2008DefinedYear Aggregate ConsumptionMillions of gallons, annualInt'l Bottled Water Assoc.aggConsumption Aggregate RevenueMillions of dollars, annual, nominal $IBID.aggRevenue Per Capita ConsumptionGallons per person, annualCalculatedperCapitaCons Nominal Price per GallonNominal dollarsCalculatedprice Real Disposable Income per CapitaReal dollars, base \= 2005, annualEconomic R. of Pres. 2010, Tbl. B-31realDisIncome Food CPIIndex (Total Food & Beverages)Economic R. of Pres. 2010, Tbl. B-60foodCPI PopulationMillionsEconomic R. of Pres. 2010, Tbl. B-34pop Real Price per GallonReal dollars, annualCalculatedrealPrice Tasks¶ Back to Contents Load the Pandas and Statsmodels packages and give them aliases. I recommend 'pd' and 'sm', respectively. You will also need the Statsmodels formula API for formulas. See Lesson #4 for examples.¶ In [ ]: ## ## Enter the code here ## Import the water consumption data. Set the row index to the years.¶ In [ ]: ## ## Enter the code here ## Print the first five (5) records.¶ In [ ]: ## ## Enter the code here ## Calculate descriptive statistics for all the variables. Intrepret the statistics.¶ In [ ]: ## ## Enter the code here ## Create several plots of the data and intrepret the patterns you see. Add more cells if you need to by clicking on the far left of a code cell and pressing the b key on your keyboard.¶ In [ ]: ## ## Enter the code here ## In [ ]: ## ## Enter the code here ## In [ ]: ## ## Enter the code here ## Create a new variable and call it Decade. This new variable will be the decade of the observation. To create this variable, divide year by 10 and return the whole part of the number. Then multiply this part by 10. Work this calculation out on paper to make sure you understand how you will get the decade. To implement this, try:¶ df[ 'Decade' ] = ( df.Year//10 ) * 10 The double forward slashes is the command to divide by 10 and return the whole part of the result.¶ In [ ]: ## ## Enter the code here ## Create a boxplot of per Capita consumption grouped by year. This is , have one boxplot for the 1990 decade and a second for the 2000 decade, but on one graph axis. Interpret the graph.¶ HINT: Try df.boxplot( by = 'Decade', column = 'price' ). In [ ]: ## ## Enter the code here ## Estimate an OLS model using per capita consumption as the dependent variable and real price as the independent variable. Display the summary report. See Lesson #4 for an example.¶ In [ ]: ## ## Enter the code here ## Retrieve and display the estimated parameters.¶ In [ ]: ## ## Enter the code here ## Retrieve the residuals and verify that the sum of the residuals is zero.¶ In [ ]: ## ## Enter the code here ## Calculate the standard error of the regression.¶ In [ ]: ## ## Enter the code here ## Well done!
Oct 20, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here