YOU ARE DOWNLOADING DOCUMENT

Please tick the box to continue:

Transcript
Page 1: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

1

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

Economics 323 (Version 15 November 2016) Business Conditions AnalysisDr. Houston H. Stokes722 [email protected] Page www.uic.edu/~hhstokes

TA: Yuhao Chen [email protected]

Required Text Business Forecasting, John Hanke, Dean Wichern 9th ed Pearson / Prentice Hall, 2009

Optional References

Data Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012.

Introduction to Time Series Using Stata by Sean Becketti. Stata Press, 2013

A Gentle Introduction to Stata 5th Edition by Alan Acock Stata Press 2016

Introduction to Econometrics by Christopher Dougherty, 4th edition, Oxford University Press, 2011.

Introductory Econometrics: A Modern Approach by Jeffrey M. Wooldridge, 5th edition, 2013, South Western Cengage Learning. This book is a bit expensive but is available from the Library.

“Notes on the Basics of Econometric Modeling geared to Dougherty (2011)" by Houston H. Stokes, is available on-line from the course web page and will be discussed in class. See file

Preliminary_Notes.docx

“Econometric Notes” by Houston H. Stokes contains some sections on important topics. It also provides an introduction to Statistics. See especially sections 1-3 and 5 which we will initially discuss. This document is available from the course web page. See file

Econometric_Notes.docx

Purpose of Course

The purpose of the course is to extend the student’s knowledge of Business Conditions Analysis by teaching statistical methods of business forecasting. This includes forecasting micro and macro data. Students will run the computer in class and get experience in a number of software systems. Students will be introduced to OLS and GLS analysis, nonlinear estimation of GLS models, recursive residual analysis options to test the stability of the estimated coefficients and simple time series ARIMA models.

Page 2: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

2

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

Students will be asked to apply their knowledge in number of computer exercises which will be graded and a final exam, which is a take home. The grading will be 2/3 computer exercises and 1/3 open book final or an approved final project. Students can work in teams of two people but must turn in an individual paper with their name on it. If working in a team, be sure and indicate your team member on the cover sheet of your homework. Once a team is formed, it must stay together for the term. Students must have selected their teams by the third week or operate as a "lone wolf" by choice. Students are free to use software of their choosing. Stata and B34S will be discussed in the course as well as some Excel. The goal is to both teach how to do applied economic work and to allow students to list software they can use on their resumes. Students wanting free B34S software systems for their home machines will be allowed to obtain them.

Objectives

The main objective of the course is to give students knowledge that will allow them to apply the economic theory they have learned in other courses in a manner that will both be useful and will facilitate them obtaining a job. Unless economic knowledge is able to be applied, it is of substantially less value and will soon be forgotten. Since forecasting provides a competitive edge, a great deal of emphasis is placed on developing systematic forecasting skills. Systematic forecasting skills are those that can be replicated by others. Many students taking this class in prior years have used their projects in job interviews to illustrate their skills and to differentiate themselves from other job seekers.

Jobs

Since many of you will want to obtain jobs that use your economics training. The best way to make a good impression at the job interview is differentiate your skills from the skills of the other applicants. It has been found that student resumes that stress the fact that they have completed a successful econometric research project in the area of the job may have a "leg up" on those applicants that appears clueless at the interview stage. To achieve this end, students can mention the types of problems they have analyzed and the software they have used on their resumes. The project alternative is in place of the take home final and would be done by each individual student.

Page 3: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

3

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

Computer Software

For many of you this will be your first time using the computer for serious work apart from the basics you have learned in the required stat courses. It is important that you do not shrink from this aspect of the course. Computer work is exacting and is necessary for research. The problem sets can be run on your own machine or from the labs where it is possible to open the class web pages and cut and paste commands into control files. Many students find it helpful to work together on their computer projects since they will be able to explain to each other what they are trying to do and learn to express themselves. What is important is to discuss results clearly and with understanding. Attaching masses of computer output is NOT a substitute for writing in a clear fashion. In business stress is laid on being clear and specific in what you have found. While many of the problems can be solved using Excel many cannot be solved using this limited software. For this reason we will be using Stata for much of our work.

Stata examples in this document provides a quick introduction to the software and will be discussed in class first to get you up and running. Since this document is on-line, you will be able to cut and paste the control files and get up and running very fast. Using the internet and cut and paste it is easy to run models.

Kohler & Kreuter (2012) provides more Stata detail, if that is needed. A student version of Stata is available from the UIC computer center for a nominal charge or can be accessed from various UIC labs.

Stata is available in SCE408, SELE 2249F, SELE 2249, and BSB 4133.  

Students can obtain a copy of Stata that expires on 6/30/2015 for $90.00

https://webstore.illinois.edu/Shop/search.aspx?keyword=Stata

Advanced references that are available for more detail on forecasting as needed.

1. Chapter 2 of Specifying and Diagnostically Testing Econometric Models Houston H. Stokes, 2nd ed, Quorum Books 1997. Updated version available on line from web page.

2. Chapter 7 of Specifying and Diagnostically Testing Econometric Models Houston H. Stokes, 2nd ed, Quorum Books 1997 Updated version available on line from web page.

3. Chapter 9 of Specifying and Diagnostically Testing Econometric Models Houston H. Stokes, 2nd ed, Quorum Books 1997. Updated version available on line from web page.

4. Stokes (200x) The Essentials of Time Series Modeling: An Applied Treatment with Emphasis on Topics Relevant to Financial Analysis Chapter 2 "Time series modeling objectives" available on line from web page.

Page 4: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

4

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

5. Stokes (200x) The Essentials of Time Series Modeling: An Applied Treatment with Emphasis on Topics Relevant to Financial Analysis Chapter 4 "Stationary Time Series Models" available on line from web page.

6. Stokes (200x) The Essentials of Time Series Modeling: An Applied Treatment with Emphasis on Topics Relevant to Financial Analysis Chapter 5 "Estimation of AR(p), MA(q) and ARMA(p,q) Models" available on line from web page.

Quick Start: To get going assume you have a file of data on the age of 6 cars and their value

age value 1 1995 3 875 6 69510 345 5 595 2 1795

Your goal is to estimate a model of the form

Your results should showValue = 1852.9 - 178.41 Age R_2 = .672

(6.45) (-3.35)

which has been discussed in the overview notes on statistics.

A simple Stata setup for this problem is

input x y1 19953 8756 69510 3455 5952 1795endlistsummarizeregress y x

which if saved with the name

cars.do

Page 5: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

5

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

can be is run in batch with the command

stata /e do cars.do

which produces in cars.log ___ ____ ____ ____ ____ (R) /__ / ____/ / ____/___/ / /___/ / /___/ 12.1 Copyright 1985-2011 StataCorp LP Statistics/Data Analysis StataCorp 4905 Lakeway Drive College Station, Texas 77845 USA 800-STATA-PC http://www.stata.com 979-696-4600 [email protected] 979-696-4601 (fax)

Single-user Stata perpetual license: Serial number: 3012042652 Licensed to: Houston H. Stokes U of Illinois

Notes: 1. Stata running in batch mode

. do cars.do

. input x y

x y 1. 1 1995 2. 3 875 3. 6 695 4. 10 345 5. 5 595 6. 2 1795 7. end

. list

+-----------+ | x y | |-----------| 1. | 1 1995 | 2. | 3 875 | 3. | 6 695 | 4. | 10 345 | 5. | 5 595 | |-----------| 6. | 2 1795 | +-----------+

. summarize

Variable | Obs Mean Std. Dev. Min Max-------------+-------------------------------------------------------- x | 6 4.5 3.271085 1 10 y | 6 1050 679.5219 345 1995

. regress y x

Source | SS df MS Number of obs = 6-------------+------------------------------ F( 1, 4) = 11.24 Model | 1702935.05 1 1702935.05 Prob > F = 0.0285 Residual | 605814.953 4 151453.738 R-squared = 0.7376-------------+------------------------------ Adj R-squared = 0.6720 Total | 2308750 5 461750 Root MSE = 389.17

Page 6: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

6

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- x | -178.4112 53.20631 -3.35 0.028 -326.1356 -30.68683 _cons | 1852.85 287.3469 6.45 0.003 1055.048 2650.653------------------------------------------------------------------------------

.end of do-file

An alternative is to place this file in the Stata do file editor and execute it!

Data is saved on-line in the Excel directory. These can be accessed by Stata or Excel from your PC.Go of class web page then to FTP location then to EXEC directory or directly tohhstokes.people.uic.edu/ftp/e323/

APPL Appliance Shipments Monthly 1983-1993BEER Monthly Beer Production 1983-1993BOATS Demand for BoatsCALDATA Monthly Sales of Electronic CalculatorsCAMPERS Camp Development DecisionCAR Monthly Deliveries of Dorf CompanyCASE10_1 Weekly Restaurant SalesCASE10_4 Lydia Pinkham Annual Data 1907-1960CASE2_2 Mr. Tux Rental DataCASE4_1 Monthly Sales Data 1983-1995CASE4_3 Consumer Credit Counseling ClientsCASE5_1 Solar Alternative Company Sales 93-94CASE6_1 Tiger Transport Company - Weight & MPGCASE6_2 Butcher Products Production DataCASE6_3 Ace Personnel CompanyCASE6_5 Credit clientsCASE7_1 Bond Market DatasetCASE7_3 Mr. Tux with Dummy VariablesCASE7_4 Consumer Credit Counseling Extended DataCASE8_1 Small Engine Doctor DataCASE8_2 Case Study 8_2 Tux DataCASE8_4 AAA Emergency Road Call Data 1988 - 1993CASE9_5 Full AAA Emergency Data Jun 87 - Jul 93CENEX Cenex Chemical ProcessCOMPANY Data Not FoundDAY90 Quarterly 90-day Treasury BillsDISINC Disposable Income 1955 - 1985EDPRICE Price of Higher Education 70-93EGGS Production of Eggs 1961-1992EMPLOYEE Employee StudyEX10_3 Daily Transportation Index CloseEX10_4 Readings from Atron ProcessEX10_5 Errors of Atronm Quality ControlEX10_6 Errors for Ed Jones Quality ControlEX10_7 Closing Stocks of ISCEX10_8 Keytron SalesEX4_1 VCR's SoldEX4_3 40 Random NumbersEX4_4 Sears SalesEX4_5 Outboard Marine 1984-1996EX5_1 Acme Tool CompanyEX5_4 Weekly Movie Video Rentals

Page 7: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

7

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

EX6_1 Milk SalesEX6_11 Hardware Advertising and SalesEX7_1 Milk vs Price vs AdvertisingEX7_12 Washington Power UsageEX7_5 Job PerformanceEX7_7 Food ExpenditureEX7_8 Zurenko Pharmaceutical CompanyEX8_10 Quarterly Sales Outboard MarineEX8_2 New Passenger Cars in the United States 60-92EX8_8 Monthly Registration of Cars 1986-1992EX9_1 Reynolds Metals 1976-1996EX9_3 Novak Corp Sales 1980-1996EX9_4 Yearly Sears Sales 1976-1966FARMS Number of US Farms 1975-1993FORREST Forest Products Car LoadingsFURNACE Shipments of Furnaces 1982-1990GNP GNP 1950 - 1991HANKEINFO Lists of Hanke DatasetsHOMES Demand for Motor HomesHOUSEHOLD Household vs populationsIMPORTS National Imports for the years 1967 to 1986INVEST Non residential Investment 1950-1989KINSTON Monthly Sales of KinstonMARRIAGE Number of Marriages 1965-1989MEDIAN Population DatasetMOODY Electric Utility Stocks Annual AveMOTEL Monthly Occupancy For Model 9 1987-1996PAPER Monthly Demand for Paper ProductsPE Quarterly Industrial P/E RatioPERFUME Monthly Demand for PerfumePR10_10 80 obs of dataPR10_11 96 obsPR10_12 IBM Stock QuotesPR10_13 Daily DEF Corporation stockPR10_14 Weekly Auto Accidents 1984-1985PR10_15 Corn Price in Spokane WashingtonPR10_7 Chips BakeryPR10_8 126 obs of test dataPR10_9 80 Obs of test dataPR2_1 Customer TransactionsPR2_10 Books Sold vs Shelf SpacePR2_13 Random Stock Vs Temp DataPR2_2 Housing PricesPR2_7 Family SizesPR2_9 Maintenance of BusesPR4_13 Marriages in US 85 - 92PR4_17 Quarterly Loans Dominion BankPR4_20 Earning Per Share Price CompanyPR5_11 Demand for Hughes SupplyPR5_12 Asset Value General American InvestorsPR5_13 Revenues from Southdown IncPR5_14 Triton Sales per sharePR5_15 Revenues for the Consolidated Edison CompanyPR5_6 Apex Mutual Fund PricePR5_9 Davenport Bond YieldPR6_11 Building Permits vs Interest RatePR6_12 Print Cost DataPR6_13 Defective parts vs batch sizePR6_3 Sales vs AdvertisingPR6_4 Checkout time vs Value of PurchasePR6_5 Maintenance cost vs age

Page 8: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

8

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

PR6_6 Books Sold vs Shelf SpacePR6_7 Orders vs CataloguesPR6_8 Yearly Investment vs Interest RatePR6_9 Forecasting a Competitor bidPR7_10 Sales = f(# outlets, # cars)PR7_11 # Registered autos = f( )PR7_13 What Makes a winning baseball teamPR7_15 Presto SalesPR7_8 Checkout time vs Purchase & # itemsPR8_11 Capital Spending 1977 - 1993PR8_13 Spending on TV AdsPR8_19 Goodyear Tires Sales 1985-1996PR8_20 Retail Sales DataPR9_10 Gas Consumption in the USPR9_11 Resort StudyPR9_12 Revenue DataPR9_13 Shareholder DataPR9_14 passengers who flew on Thompson Airline planes.PR9_15 Thomas Furniture Company salesPR9_16 Dicksen vs Industry SalesPR9_17 Savings in period 1935 - 1954PRES New Prescriptions 1990-1996PRIME1 Quarterly Prime Rate 1985-1991PRIME2 Monthly average prime 1945-1995RAILROAD Railroad Labor Annual Average Cents Per HourREFILL Monthly refill data 1983-1990RIDERSHIP Daily Bus RidershipSALARY Age vs Salary DataSEARINC Sears Sales 1955 - 1985STATIONS Number of TV stations changing hands in 1991STOCK S & P Monthly 1945-1995TRAVEL US Citizen departures 1961-1991WASH Boats - Motor Homes - IncomeWELLHEAD Average Wellhead Price, Natural gas 72-93WOOD Monthly Wood Production 1992-1996

Problem Sets, Final/Project:

There are 5 problem sets. These will be due on the 4th, 6th, 9th, 11th and 13th week for problem sets 1 - 5 respectively. Lates will not be accepted unless there is prior written approval. Problem set answers should be typed and carefully laid out. Since they will be 2/3 of the grade in the course, care should be taken in their preparation. If past classes are any indication, an impressive layout can be leveraged in a subsequent job interview to illustrate your capability to solve "real world" problems using modern methods of analysis. The remaining 1/3 of the grade is either the student project which involves obtaining data from the web or other sources and estimating a regression and ARIMA model OR taking the take home final. The objective of the project is to give students a paper which illustrates their capabilities which they can use in job interviews to further show their capability. If you have a job goal in one specific industry, it is a good idea to select a paper topic that is related to this area. Further information on the project is contained below.

Page 9: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

9

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

Assignments

I. Introduction to Data Analysis

- Hanke-Wichern Chapters 1-2- Stokes [5], [6]

II. Regression Analysis

- Hanke-Wichern Chapter 6, 7- Stokes Econometric_Notes- Stokes (1997) Chapter 2 listed as [2]- Stokes (2004) Chapter 2 listed as [9]

III. Recursive Residual Analysis

- Stokes (1997) Chapter 9 listed as [4]

IV. ARIMA Model Building - Identification and estimation.

Stokes (1997) Chapter 7 listed as [3]Stokes (2004) Chapter 4 "Stationary Time Series Models" listed at [10]Stokes (2004) Chapter 5 "Estimation of AR(p), MA(q) and ARMA(p,q) Models" listed as [11]Hanke-Wichern Chapter 8 and 9

Problem Sets

1. Introductory Statistical Analysis - Due 4th week

2. Estimation and Testing of Regression Models. Due 6th week.

3. Applied Econometric Analysis. Due 9th week

4. Identification of ARIMA Models using real and generated data. Due 12th week

5. Estimation of ARIMA Models. Due 14th week.

Page 10: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

10

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

Terms and concepts to understand

OLS Model – define, state assumptions and discuss the effect on the estimates or standard errors if the assumptions of OLS are not met

Multicollinearity

Simultanity

Exogenous, Endogenous

Differences-in-Differences model – define and discuss interpretation

Regression discontinuity

Proxie variable

Probit, logit and tobit model – define and show how used.

Panel Data – define and slow the advantages and disadvantages of Fixed effects model, random effects model.

Instrumental variable - Define and show how used. Be able to discuss and give examples.

Effects of serial correlation, heteroskedasticity and model specification on estimated coefficients, estimated standard errors and the ability of a model to accurately draw inferences.

Population

Sample

Sample selection bias.

Datasets:

Datasets for the problem sets are on-line under the course web page. See FTP location.

Page 11: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

11

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

Problem Set # 1 Introductory Statistical Analysis

Goals: Introduction to ComputerUse Data Sampling

1. Hanke-Wichern (2009) page 50 # 12 list data on the number of books sold (BSOLD) and the feet of shelf space (SHELFS). You are asked to calculate the correlation BSOLD and SHELFS. In addition run a regression of BSOLD = f(constant SHELFS). Draw a skatter diagram. Use your model to predict how many books will be sold if the shelf space is 8.23. For software you can use any program that you would like.

The means obtained should be:

Variable Label # Cases Mean Std. Dev. Variance Maximum Minimum

WEEK 1 Week Data Collected 11 6.00000 3.31662 11.0000 11.0000 1.00000 BSOLD 2 Books Sold 11 210.182 54.7153 2993.76 295.000 125.000 SHELFS 3 Shelf Space 11 4.88182 1.42816 2.03964 7.70000 3.10000 CONSTANT 4 11 1.00000 0.00000 0.00000 1.00000 1.00000

Stata will run the problem with statements:

input week bsold shelfs* Data from Hanke - Wichern Edition 9 page 50 # 12* Data from Hanke - Wichern Edition 8 page 48* Data from Edition 7 page 441 275 6.82 142 3.33 168 4.14 197 4.25 215 4.86 188 3.97 241 4.98 295 7.79 125 3.110 266 5.911 200 5.0end

label variable week "Week Data Collected "label variable bsold "Books Sold "label variable shelfs "Shelf Space "

summarizedescribeset graphics ongraph twoway scatter bsold shelfs, saving(graphp1_1)

Page 12: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

12

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

corrregress bsold shelfs

2. Hanke-Wichern (2009) page 50 problem 13 shows a dataset of 200 weekly observations of temperature in Spokane (Temp) and the number of shares of stock trades for Sunshire Mining (Shares). The dataset is Pr2-9.xls, You are asked to calculate the correlation between Shares and Temp and run a model Shares = f(constant, Temp). Code to load from a file is shown below shown below together with You can either run this problem with a modified script in “batch mode” or load the datafile directly into Stata from the web and give the appropriate commands. You first should save the excel file on your pc then give the correct Stata commands to load it.

import excel using "c:\master\master1\class\e323\hanke\excel\ch2\pr2-9.xls",firstrowsumm* listcorrregress Shares Temp** Alternative ways to do a bootstrap*regress Shares Temp, vce(bootstrap, reps(400) seed(10101))** Here we see what the coef look like using resampling techniques.bootstrap _b _se, reps(400) seed(10101):regress Shares Tempmatrix list e(b_bs)*regress Shares Temp, robust

When you load the data means should be: Variable | Obs Mean Std. Dev. Min Max-------------+-------------------------------------------------------- C1 | 200 100.5 57.87918 1 200 Shares | 200 48.86 29.28461 0 99 Temp | 200 47.75 28.176 1 99

Discuss in detail what you find in terms of coefficients and SE’s of an OLS model predicting Shares with Temp without an adjustment in the coef or SE.

2. The next part of the problem is to sample the data 400 times (with replacement) and see what happens to the SE and the coef.

3. Using the OLS results and the bootstrap coef forecast Shares for a Temp value of 63. Show your work.

Hint: The way Stata works Shares is not the same as shares. The same for temp

Page 13: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

13

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

Problem Set # 2. Regression Analysis

Goals: OLS Model SpecificationIntroduction to GLS

Pindyck & Rubinfeld [1981] page 458 - 466, which can be consulted for more detail, contains data on a number of economic series. This data is on line in member penrub.dct and can be called from inside Stata. The steps to load this data on PC are

infile using “c:\master\master1\class\e323\penrub.dct”, clear

Means and variable names and descriptions are:

Variable # Label Mean Std. Dev. Variance Maximum Minimum

time 1 1966.50 6.38065 40.7126 1977.00 1956.00 qt 2 QUARTER 2.50000 1.12444 1.26437 4.00000 1.00000 c 3 PERSONNAL CONSUMPTION EXP. 58 DOLLARS 415.268 98.1198 9627.50 607.500 279.100 g 4 GOV. EXP. GOODS & SERVICES 58 DOLLARS 124.123 22.2271 494.042 155.500 84.6000 gnp 5 GROSS NATIONAL PRODUCT IN 58 DOLLARS 640.481 141.650 20064.6 901.200 434.200 gnpp 6 POTENTIAL GNP IN 58 DOLLARS 696.262 208.121 43314.5 1089.40 413.400 iin 7 INVENTORY INVESTMENT IN 58 DOLLARS 5.15966 4.85589 23.5796 17.5600 -13.1600 inv 8 LEVEL OF BUSINESS INV. IN 58 DOLLARS 162.439 37.1501 1380.13 223.200 111.300 inr 9 FIXED NON RES. INVEST IN 58 DOLLARS 67.0768 17.2897 298.934 94.5500 40.4400 ir 10 FIXED RES INV NON FARM STRUCT 58 DOLLARS 28.8623 6.27482 39.3734 44.2900 19.4100 m 11 M/P IN 58 DOLLARS 149.040 8.11765 65.8962 165.400 136.800 p 12 IMPLICIT GNP DEFLATOR 132.515 35.3421 1249.07 218.400 93.9000 rl 13 LONG TERM INTEREST RATE 5.05501 1.31016 1.71653 7.27000 2.88700 rs 14 SHORT TERM INTEREST RATE 4.38733 1.66629 2.77652 8.32300 0.957000 trans 15 FED GOVERNMENT TRANSFER PAY. 58 DOLLARS 36.4505 15.7636 248.492 67.3300 16.1100 ur 16 UNEMPLOYMENT RATE 5.39624 1.35257 1.82945 8.86700 3.40000 w 17 NOMINAL WAGE IN DOLLARS PER HOUR 3.79868 1.55299 2.41178 7.41300 1.90400 wlth 18 INDEX OF REAL HOUSEHOLD WEALTH 1.96199 0.372728 0.138926 3.01800 1.33500 yd 19 DISPOSIBLE INCOME IN 58 DOLLARS 564.101 124.761 15565.2 793.800 382.400 constant 20 1.00000 0.00000 0.00000 1.00000 1.00000

Data file contains 88 observations on 20 variables. Current missing value code is 0.1000000000000000E+32

Data begins on (D:M:Y) 1: 1:1956 and ends on 1:10:1977

Frequency is 4.

Assignment: Be sure that you have read and understand the material in Stokes [1997] Chapter 2 and Hanke-Wichern [2009] Chapter 7

1. Define and discuss the following econometric problems:

a. Heteroskedasticity b. Serial Correlation c. Simultaneity

Page 14: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

14

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

2. Using Stata estimate the following models.

a. ct = + 1 ydt

b. ct = + 1 ydt + 2 ct-1

c. ct = + 1 ydt + 2 ct-1 + 3 ydt-1

d. ct = + 1 [ydt - transt] + 2 transt + 3 [wltht - wltht-1] + 4 [rst + rst-1 + rst-2 +rst-3] + 5 ct-1

You will have to build the variables [ydt - transt] and [rst + rst-1 + rst-2 + rst-3]. The following code will do this task if the main dataset has been loaded.

infile using "c:\master\master1\class\e323\penrub.dct", clear* infile using "g:\e323\penrub.dct", clear* set a time variablegen trend = _ntsset trendsummdescribe* Model aregress c ydestat dwatson* GLS for models with no lagged dependent variable on rightprais c yd* what happend if you try next command?* prais c yd, corc** Does the rho make senseprais c yd, ssesearch*newey c yd, lag(1)

** build datagen lag_c = L.cgen lag_yd = L.ydgen yd_m_trans = yd-transgen dif_wlth = wlth - L.wlthgen sum_rs = rs + L.rs +L2.rs +L3.rs* Model bregress c yd lag_c* Model cregress c yd lag_c lag_yd

* Model dregress c yd_m_trans trans dif_wlth sum_rs

What models can be estimated using GLS?Discuss what you have found.

Page 15: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

15

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

Page 16: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

16

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

Problem set # 3 – Applied Econometric Analysis

1. This problem is based on a modification of problem 6 on pages 314 of Hanke

Explain each of the following concepts and how it might be used. a. Correlation matrixb. c. Multicollinearityd. Residuale. Dummy variablef. Stepwise regression.

2. Solve Hanke problem 12 page 317. Data load means are:

Variable | Obs Mean Std. Dev. Min Max-------------+-------------------------------------------------------- Sales | 11 29.60909 13.75947 3.5 52.3 Outlets | 11 1554.364 843.9054 125 2850 Auto | 11 12.42727 6.858585 4.1 24.6 Income | 11 60.25455 27.1665 19.7 98.5

The following partial program shows you how to fit a tentative model and obtain the fit and the error.

import excel using "c:\master\master1\class\e323\hanke\excel\ch7\Pr7-13.xls",firstrowsummdescribelistcorr*regress Sales Incomepredict fitpredict error, residlist

*drop fitdrop error

a. Analyze the correlation matrixb. How much error is involved in the prediction for region 1?c. Forecast the annual sales in region 12, given 2,500 retail outlets and 20.2 million automobiles

registered.d. Are the partial regression coefficients sensible?

Page 17: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

17

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

3. This problem is based on problem 16 on page 320 of Hanke. The correct commands to load the data and get means and correlation are:

import excel using "c:\master\master1\class\e323\hanke\excel\ch7\Pr7-15.xls",firstrowsummlistcorr

ERA = earned run averageSO = Strike outsBA = Batting averageRUNS = RunsHR = Home RunsSB = Stolen Bases

Variable | Obs Mean Std. Dev. Min Max-------------+-------------------------------------------------------- WINS | 26 80.92308 9.711532 57 98 ERA | 26 3.904615 .3906429 3.06 4.59 SO | 26 938.0769 73.26168 739 1033 BA | 26 .2556538 .0096992 .241 .28 RUNS | 26 697.1923 70.10679 576 829-------------+-------------------------------------------------------- HR | 26 130.1154 32.00791 68 209 SB | 26 120 37.89776 50 221

. corr(obs=26)

| WINS ERA SO BA RUNS HR SB-------------+--------------------------------------------------------------- WINS | 1.0000 ERA | -0.4937 1.0000 SO | 0.0488 -0.3932 1.0000 BA | 0.4460 0.0152 -0.0067 1.0000 RUNS | 0.6267 0.2788 -0.2091 0.6449 1.0000 HR | 0.2088 0.4896 -0.2150 0.1536 0.6636 1.0000 SB | 0.1904 -0.4039 -0.0617 -0.2070 -0.1623 -0.3053 1.0000

Assume you have been retained to determine what is important for developing a winning team.

a. Discuss the importance of each variable using correlation and regression analysis.b. What is a best equation to use to forecast wins? Give detailed reasons why you selected this

equation. The stepwise command might be useful

stepwise, pr(.2) : regress y x

c. Prepare a report to submit to the team manager.

Page 18: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

18

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

Problem set # 4 - Identification of ARIMA Models using real and generated data

Assignment - Review Stokes [1997] Chapter 6 and Hanke-Wichern [2005] chapter 9

1. Define and discuss the use of:

a. Autocorrelation Function (AFC)

b. Partial Autocorrelation Function (PAFC)

2. Discuss what you would look for to identify:

a. An AR(1) model

b. A MA(1) model

3. Estimate the ACF and PACF for the variables C, RS, and M in dataset PENRUB. It is recommended that you investigate the original series, the first differenced series. From your work, what is the correct amount of differencing? Why? What do these ACF tell us about the series?

Page 19: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

19

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

4. The files test_arima_1500.dct and test_arima_15000.dct generate series with the following characteristics:

a. (1-.7B)Xt = et.

b. Xt = (1-.7B)et.

c. (1+.7B)Xt = et.

d. Xt = (1+.7B)et.

e. (1-.65B)Xt = (1-.4B - .7B4)et.

for 1500 and 15000 observations respectively. Means for the 1500 data are

Variable | Obs Mean Std. Dev. Min Max-------------+-------------------------------------------------------- ar1_a | 1500 -.000633 1.45299 -5.480957 4.640228 ma1_b | 1500 -.0003761 1.245439 -4.938618 4.3658 ar1_c | 1500 -5.77e-06 1.417546 -5.18021 5.23172 ma1_d | 1500 .0000899 1.241997 -4.590242 3.586889 arma_e | 1500 .0008087 1.34893 -5.08477 4.419892-------------+-------------------------------------------------------- norm | 1500 -.0001431 1.018634 -4.000103 3.422285 trend | 1500 750.5 433.157 1 1500

a. Estimate the ACF and PACF for the first five series and discuss.

b. Next estimate the correct models and see how close you get. Contrast results for the 1500 observation series with the 15000 observation series.

Computer help:

* infile using "c:\master\master1\class\e323\test_arima_1500.dct",clear infile using "c:\master\master1\class\e323\test_arima_15000.dct",clear

* set a time variablegen trend = _ntsset trendsummdescribecorrgram ar1_a, lags(24)corrgram ma1_b, lags(24)corrgram ar1_c, lags(24)corrgram ma1_d, lags(24)corrgram arma_e, lags(24)corrgram norm, lags(24)

arima ar1_a, arima(1,0,0)arima ma1_b, arima(0,0,1)

Page 20: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

20

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

arima ar1_c, arima(1,0,0)arima ma1_d, arima(0,0,1)arima arma_e, ar(1) ma(1,4)

Page 21: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

21

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

Problem set # 5 - Estimation of ARIMA Models

Goal: Be able to forecast

1. Discuss the advantages and disadvantages of ARIMA models in comparison to large scale models. Under what conditions would an ARIMA modeling procedure be appropriate, a large scale econometric modeling procedure be appropriate?

2. Using the ACF and PACF that you estimated in case study # 2, estimate the ARIMA models for C, RS, M. Be sure to have the correct amount of differencing. Try your models using the predict option. Discuss your models. A sample job is shown. Two ARIMA models are shown. One appears to work better. Why?

infile using "c:\master\master1\class\e323\penrub.dct", clear* infile using "g:\e323\penrub.dct", clear* set a time variablegen trend = _ntsset trendsummdescribe

* arima c, arima(1,1,1)arima c, ar(1,2,3,4,5)predict arxb_cpredict ardy_c, dynamic(80)list c D.c ar*

Page 22: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

22

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

Help on autobj.

AUTOBJ - Automatic Estimation of Box-Jenkins Model

The ARMA command estimates univariate BJ models using ML and method of moments. Since only one AR and MA factor is allowed, this command can be used to select relatively simple models from inside a user selected framework. If many series are to be filtered quickly, this command should be considered. Models with very many terms can be estimated.

The more complex command AUTOBJ will automatically identify models with AR, MA, SAR and SMA factors without the user having to specify the model. This use of time series AI allows filtering of a large number of quite different series possible. A limit of 10 terms can be in the model but up to 6 factors can be estimated. These limits are due to the Box- Jenkins philosophy that suggests parsimonious models be used.

The AUTOBJ command is based on the BJIDEN and BJEST routines available as B34S commands. The underlying code is based on the Peck Box Jenkins program that was developed under the supervision of George Box at UW starting in the late 60's.

In addition to automatic model selection using the :autobuild option, the AR and MA parameters can be specified in "manual" mode of operation..

call autobj(x :options);

x series to filter.

If the user wants to impose differencing, this should be done outside the command or inside the command with the command :rdif or :sdif. Other wise using automatic model building, differencing will be selected if the AR parameter is above the :roottol value which defaults to .8.

:autobuild - Automatically selects the arima model starting from a "generic" arima(1,1) model on appropriately differenced data.

:rawacfpacf - Give Raw ACF and PACF prior to model being fit..

:difrawacf - Gives difference as well as raw acf and pacf if :rawacfpacf set.

:assumptions - Lists assumptions. Not usually used.

:seasonal n - Sets the seasonal period. If this is not present seasonal differencing will not be attempted.

:seasonal2 n - Sets the second seasonal period. If seasonal2 is set, seasonal must be set. Used with hourly and weekly data.

:longar n - Sets initial default AR order.

Page 23: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

23

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

Default=1. Range 0-2. This is not allowed if seasonal2 is set.

:longma n - Sets initial default MA order. Default=1. Range 0-2. This option is not allowed if seasonal2 is set.

:nodif - Suppress automatic differencing selection.

:rdif - Forces Regular Differencing.

:sdif - Forces Seasonal Differencing.

:trend - Estimate a trend if there is differencing.

:noest - No estimation will be performed. This option requires that the model has been saved.

:cleanmod - On the last step, the model will be cleaned of parameters that have |t| values LT droptol. This option makes a very parsimonious model.

:forcedstart - Forces a default starting value of .1 to be set. This is usually not needed.

:nosearch - Turns off spike hunting.

:spikelimit i - Sets limit to look for spikes. Default = max(12,2*seasonal)

:spiketol r - Sets t for spike inclusion. Default = droptol. If this is set too low the program will cycle since a term will be added which will not be significant due to the |t| not meeting the droptol.

:arlimit r - Sets a value to check for |t| of adjacent ACF terms. If r is set smaller, it is more likely AR terms will be added. Change this value with caution. Default = 1.3.

:startvalue r - Sets default parameter start value for automatic model building. Default = .1

:print - Print results.

:printres - Print residuals.

:printit - Print iterations

:printsteps - Prints Model selection steps for automatic model building.

:backforecast - Use backforecasting. This option allows

Page 24: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

24

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

residuals to be calculated for all data points. It can result in instable estimation. This option should be used with care.

:maxtry n - Maximum tries at auto model selection. Default = 4.

:roottol r - Set auto model differencing tolerance. Default = .8

:droptol r - Sets drop tolerance. Default = 1.7

:eps1 r - Sets max change in relative sum of squares before iteration stops. Default = 0.0 => this criterian not used.

:eps2 r - Sets relative max change in each parameter. Default = .004

:maxit i - Sets maximum number of iterations allowed. Default = 20

:nac i - Sets # autocorrelations printed. Max = 999.

:npac i - Sets number of partial autocorrelations printed.

Options to override auto selection of the model.

Note: Specify AR and MA in this order if present.

:ar ivec - set AR orders. Can specify up to three factors. For example:

:ar index(1 2 3) index(12)

:ma ivec - set ma orders. Can specify up to three factors. For example:

:ma index(1 2 3) index(12)

:arparm rarray - Initial ar values. Usually not needed.

:maparm - Initial ma values. Usually not needed.

:forecast index(i1 i2)

- Sets forecast number and origin. Limit for number = 100

:smodeln - Sets model save name. If :noest is in effect, this sets the model name to used to make forecasts.

Page 25: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

25

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

Variables created if options selected:

%numar - Number of AR factors

%numma - Number MA factors

%numdif - Number difference factors

**********************************************

Defined if %numar > 0

%arparms - AR parameters

%arse - SE of AR parameters

%arord - AR orders

%narfact - Number of parameters in each factor

**********************************************

Defined if %numma > 0

%maparms - MA parameters

%mase - SE of MA parameters

%maord - MA orders

%nmafact - Number of MA parameters in each factor

**********************************************

Defined if %numdif > 0

%diford - Dif Orders (6 element array)

**********************************************

%coef - constant, ar parameters, ma parameters

%se - Coefficient Standard Errors

%t - Coefficient t scores

%cname - Coefficient names

123456 AR - 1 AR - 2 MA - 1 MA - 2

give info on the factor

%corder - Coefficient order

Page 26: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

26

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

Defined if Forecasting

*********************************************

%fcast - Vector of forecasts

%foreobs - Vector of Forecast obs

%fse - Forecast standard error

%fpsi - Forecast psi weights

%nres - nob -(max(arorder, maorder)+2)

%res - Residual vector of length %nres.

%resobs - Observation # of residual

%y - Y vector lined up same as %res.

%yhat - Estimated y

%yvar - Y variable name

%rss - Residual sum of squares

%sumabs - Sum of |e(t)|

%maxabs - Maximum |e(t)|

Notes: If :ar or :ma is found, auto identification will not be performed.

If auto identification is used, the beginning values will often be close to the final values because of the "hidden" identification estimation runs. The switch :printsteps will show these estimations although usually this is not needed.

The following statement will detect if the program ran:

if(kind(%res).eq.-99)then; call print('AUTOBJ failed'); endif;

Example # 1 Identify the Gas model:

b34sexec options ginclude('gas.b34'); b34srun;

b34sexec matrix; call loaddata; call load(rtest); /$ /$ This roottol setting forces no differencing /$ /$ call autobj(gasout :print :nac 24 :npac 24 /$ :roottol .99 :autobuild );

Page 27: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

27

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

/$ This turns off differencing

call autobj(gasout :print :nac 24 :npac 24 :nodif :autobuild );

call rtest(%res,gasout,48);

/$ Default let program decide

call autobj(gasout :print :nac 24 :npac 24 /$ :printsteps :spiketol 2.0 :autobuild );

call rtest(%res,gasout,48);

b34srun;

Example # 2 Identify Retail Data

b34sexec options ginclude('b34sdata.mac') member(retail); b34srun;

b34sexec matrix; call loaddata; call load(rtest);

call autobj(applance :autobuild :seasonal 12 :nac 36 :print :assumptions /$ /$ maxtry limits model /$ :printsteps :maxtry 2 /$ :forecast index(20,norows(applance)) );

call names(all); call tabulate(%cname,%corder,%coef,%se,%t); call print(%yvar,%numar,%numma,%numdif); if(%numdif.ne.0)call print(%diford); if(%numar.ne.0) call print(%narfact,%arord,%arparms,%arse); if(%numma.ne.0) call print(%nmafact,%maord,%maparms,%mase);

b34srun;

Page 28: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

28

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

SAS help follows

* arma(0,1,2) Model;proc arima;identify var=c(1,1) noprint;estimate q=(2);forecast lead=10;run;* arma(2,1,0) Model;proc arima;identify var=c(1,1) noprint;estimate p=(2);forecast lead=10;run;* arma(1,0,2) Model;proc arima;identify var=c noprint;estimate p=(1) q=(2);forecast lead=10;

run;

Page 29: Economics 323 Fall 1989hhstokes.people.uic.edu/ftp/e323/e323bib.doc · Web viewData Analysis Using Stata by Ulrich Kohler and Fraunke Kreuter. 3rd Edition, Stata Press, 2012. Introduction

29

Economics 323 Business Conditions Analysis Spring 2017 Dr. H. H. Stokes

Project

For those selecting this option, the project will consist of the individual student selecting 2 to 3 series and fitting an ARIMA models to the series. These series must be related to some interesting topic that is relevant. After fitting ARIMA models the student should next relate these series using regression methods. In your write up of the project briefly outline the economic theory you are basing your results on, the techniques that you are using and the results obtained. The objective of this project is to test how well you can apply the theory that you have learned to data you have selected. A major objective is to have to be able to show a completed econometric study at a job interview. The paper should be 15-20 pages typed. In the past many students have used corrected copies of this paper in the job interview process with great success. Being able to a research project in econometrics will really set you apart from other job seekers. Students wishing to do this option must submit a 1/2 page proposal by the end of the 10 th week. Project papers are due the end of the 15th week. With special approval, the paper can be a team project but in this case a longer and more extensive project on the order of 40 pages is required.


Related Documents