Introduction to Econometrics
Introduction to Econometrics ECO 4305
Popular in Course
Popular in Economcs
This 112 page Class Notes was uploaded by Kaden Orn on Thursday October 22, 2015. The Class Notes belongs to ECO 4305 at Texas Tech University taught by Summers in Fall. Since its upload, it has received 63 views. For similar materials see /class/226392/eco-4305-texas-tech-university in Economcs at Texas Tech University.
Reviews for Introduction to Econometrics
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 10/22/15
ECO 4305 Econometrics Notes on empirical exercise E31 using gretl You ll need to download the le CPS92704xls from the book 3 companion web site or my web site but not the gretl site Go to student resources click on Data for empirical exercises on the lefthand menu and click on the Excel version of the CPS data Everything else in these notes comes from the gretl site gretlsourceforgenet Step 1 If you haven t already downloaded and installed gretl you should do that now The web site is httpgretlsourceforgenet and there are links there to both the Windows and Mac versions Look down the lefthand side of the page for quick links or scroll down to the Download section Ignore all the Linux stuff current source package generic binaries etc Unless of course you use Linux If you follow the Windows link you ll notice that there are 2 options It shouldn t matter which one you get but the current snapshot from Wake Forest is slightly more up to date1 While you re at the gretl page go ahead and download the Verbeek data sets from the data page and install that too This should create a subdirectory called gretldataVerbeek 1 You may experience a problem if you try to install this on a shared computer and you don t have administrator privileges I suspect that won t apply to most of you but if it does let me know Step 2 Start gretl amp load the data Doubleclick on the gretl icon to launch it This is what the main window looks like 5 grail new l W W Na data le laaded x Vanamme Desmmm E E OL stari an 2m 5m man gr Hum Pretty minimalist huh To load the wages data choose Open data from the le menu then Sample file You should get a box like this with various tabs corresponding to different data sets 59 r y u u 1 StockrWaBon 2e Verbeek vvoodrrdge He Sum mary asseBZ mm on yarwous asseB mom bene bwages Wages expenence and educa on a j g g 1 E E E a x o lt a a g E a came ex e em by ndustry monuny domng sa es of men s rashron stores houand forwardz forward exchange rates mommy garch dauy exchange rate data housrn house once and charactensucs onsumpuon hugreun and Lu UK aggregate hcome and consumpuon rates nterest rates at yarwous mamrmes abourz emp oyment by Bexgran rms ma es abornmarket pane 198071987 3 a Moo 2 money US monetary data quarteny patenB patenB ntemauona manufacmnng rms pe once and esmv vgs sap 500 once and exchange rates France and Ita y pnchg remrns on stock porcrohos schoohng educauon eye s US ma es spEOO dauy remrns sap 500 spu ous hdependent random W toba c obacco consum US abor market th W hngness to pay Pormga a Ks puon Bexgran househo ds 1987 2 1 S a Click on the Verbeek tab and then doubleclick on wagesl That will load the data into gretl and the main gretl Window should look like this a grad Ede Zoo s Dam Mew Add sampxe yarwab g Mode e p Wageslgdt m Vanab e name Desc puve abe 0 cont autorgenerated consmnt m Zmab mmwan 3 schoo yearsofschoohng 4 Wage On 1980 per hour Undeted FuH range 1 7 3294 E E El Ix E E L E El To run a regression of wages on gender choose Ordinary Least Squares from the Model menu a grad Elle 100 gm Mew Add gample yanable Wageslgdt ID x w Vanable name l Descnpuve label omer hnear models gt 0 const autorgenerated constant Nonlwearmodels gt nm N x 2 m llfmale omerwlse 3 school yearsofschoohng aobustesmauon 4 Wage an 1950 per hour Maxwmum hkehhood GMM gmulmneous equauons Undeted mu range 1 7 3294 BEEIIXEELE El You ll get a dialog box Where you can specify the y and Xvariables Elle nabs Mew Add sample yariable Model elp m gw Undeted mu range 1 7 3294 Select wage as the dependent variable and male as independent Gretl includes a constant automatically Hit OK and you ll get another Window with the regression output gull E e Wag Ioo s Data Mew Add iamp e yarwab e es yet 1 ID 0 Ede at less save graphs Ana ysws LaTeX 1 2 Model 1 on estlmates uslng the 3294 uhservatluns 173294 De endene varlahle wa e 3 p g 4 VARIABLE COEFFICIENT STDERROR T STAT P VALUE cenee 514692 uu312243 63366 ltuuuuu1 6 male 11661D n112242 1u3as ltuuuuu1 Mean of dependent varlahle 575759 Standard devlatlun of dep var 326919 5 of e red reslduals 34D769 se data enter f r 1d 1 321736 3292 e 223 en 9an AIC 17u435 Schwarz aneslan cueeuen 51c 17D6EI7 HannaerLunn cueeuen HQC 17D52E Undeted mu range 1 e 3294 E E E E3 Ix 12 k L E E3 That should get you started I ll go over this some of it anyway in class Good luck ECO 4305 Econometrics Notes on empirical exercise E31 using gretl You ll need to download the le CPS92704xls from the book 3 companion web site or my web site but not the gretl site Go to student resources click on Data for empirical exercises on the lefthand menu and click on the Excel version of the CPS data Everything else in these notes comes from the gretl site gretlsourceforgenet Step 1 If you haven t already downloaded and installed gretl you should do that now The web site is httpgretlsourceforgenet and there are links there to both the Windows and Mac versions Look down the lefthand side of the page for quick links or scroll down to the Download section Ignore all the Linux stuff current source package generic binaries etc Unless of course you use Linux If you follow the Windows link you ll notice that there are 2 options It shouldn t matter which one you get but the current snapshot from Wake Forest is slightly more up to date1 While you re at the gretl page go ahead and download the StockWatson data set from the data page make sure you get the version for the second edition and install that too This has both data sets and replication scripts ie programs for reproducing their results A couple comments on gretl s directory structure Under the main gretl directory are a bunch of subdirectories The only one we need to worry about for now is data If you install the StockWatson data by running the installer program you should see a subdirectory of data called stockiwatson2 I moved things around so that I ve got the data les in gretldatastock7watson2 and the scripts in gretlscriptsstock7watson2 This is completely up to you though 1 You may experience a problem if you try to install this on a shared computer and you don t have administrator privileges I suspect that won t apply to most of you but if it does let me know Step 2 Start gretl amp load the CPS data Doubleclick on the gretl icon to launch it This is what the main window looks like 5 grail new l W W Na data le laaded x Vanamme Desmmm E El OL 5m man gr Hum stari an 2m Pretty minimalist huh Loading the data is pretty easy If you downloaded the XlS version click on the File menu and choose Open data then Import and scroll down to Excel 1 P59234th 2 0592 xls 3 naman th mm sz les i255er N25 39 E El OLia w 2m 39 9E39 4mm Use the explorer to navigate to where you ve got the CPS92704XlS le and click on it and the import process will start Click OK in the rst box that pops up and No in the second Ifyou downloaded the gretl version cps92704gdt choose Open data from the file menu then User le Browse to where you downloaded the le then select it and hit OK In either case the main gretl window will then look like this 15 M5 gal W M We lemme W l new w my mac Vanahlename Desmvhvelahel u ans auta39qenevated mm she bachelm female undated mu vanqe 1 V 15588 EEEEQOLEE w gm war 9 The variables are the same as those in the spreadsheet gretl adds an autogenerated constant as variable number 039 ignore this Step 3 create dummy variables for different years genders and educational attainment The variables bachelor and female are already in dummy variable format 01 and we could pretty much work with them as they are We do need to do a bit more work with the year variable and I think it s easier to keep track of things if we add a couple more as well So first let s deal with year Click on variable then de ne new variable at the bottom You ll get a box saying enter formula for new variable To create a variable called yr792 that s equal to 1 if yearl992 and 0 otherwise enter the following in the box yr792 year 1992 Click OK or hit enter and you ll see that the new variable is now in the list quotzf gren BEE Elle quls Data Mew Add Sample Manama MDdEl Help i CP5927U4VSEWDlE 9dr m w Vanable name Descvlutwelabel u t a t u manemed constant W32 yewiggz undated mu vanue 1 r 27 You may notice in the screen shot above that my female variable has changed its name to women I did this and you can too by clicking on Variable then edit attributes and entering the new name You don t have to do this though Before we go on a word about dummy variables lfyou doubleclick on yr792 or female you ll see it s a string of 1 s and 0 s which is fine But we don t want the 0 s to in uence the averages for any of these variables so we need to get rid of them There are two ways to do this lthink the easiest is to slightly modify the formula you use to create them by using the zeromiss function men zeromissfemale 0 What this does is to take all the 0 s produced by female 0 that is all the observations corresponding to women and replace them with blanks The other way is to create all the dummy variables first then select all of them men women yr792 yr704 bachelor and hs click on the Sample menu and select set missing value code You ll get a box asking you for the value to be read as missing Type in 0 and click Now ifyou doubleclick on female you ll see a bunch of l s and blank spaces which is what we want Following the same procedure we can create variables for hs high school diploma or bachelor 0 and yr704 You can use any variable names that you want to but they can t contain spaces I d suggest something intuitive amp easy to remember You can also enter a brief description using edit attributes Here s how things look at this point ale Duals Esta Mew Add ample Manama Model P5927D4rsamul2 mm ID x Vanable name Destvlutwelabel aut help l u enevaled constant W32 veav 1992 men WDm n vLm veav2uu4 hs bachelm undated mu 12mg 1 r 27 Step 4 OK almost done Now we need to split the earnings data by education year and gender For example let s have ahe792 be the average wage for all respondents in 1992 and aheihsimen792 be the 1992 wages for the group of men with high school diplomas Now we can go ahead and finish by creating variables corresponding to the different combinations of dummy variables ahe792 aheihsimen792 etc As we did before open the Variable menu and select Define new variable To get the average earnings in 1992 we want to multiply the earnings variable by yr792 so just enter that formula in the dialog box like this Elle Innls Data mew Add garnple vallable Mmel HelD P5927D4rsamulz out in x Vavlable name Descllutlvelabel u rlst au 7 ED 79725213123 constant w 92 yeamggz um EI vem D4 bachelm a gletl add var EntEV fulmula tel new Vavlable ahe ahEWLQZl Help X ganeel Undated Full value 1 727 ammonia Again you could enter a description using VariableEdit attributes That might be more informative than the formula Do the same thing to create aheihsimen792 just the product of the appropriate dummy variables I won t go through the details of constructing the variables for the other groups 7 it s exactly the same procedure Step 5 calculate the summary statistics The last step will give you the averages standard deviations and sample sizes that you need to calculate the confidence interva s Now for the easy part Click on ahe792 open the Variable menu and select Summary statistics You ll get a new window with the sample mean standard deviation and a bunch of other stuff Yaals Data Mew Add iamle lavishle Madel u 1 2 3 Summary Scaclsclciy usmg the observacluns 1 7 15555 4 in the varlahle aheigz 75m valld observacluns 5 5 7 a Standard devlaclun 55553 c v u 47am skewness 11751 Ex kurcusls 2 2475 lass undated mu vanqe 1 V 15588 E oL a v Elm v i v w gm am f gri H g r q 444m The sample size is at the top 7 in this case 7602 7 the number of valid observations Note you can also get the summary statistics from the View menu Session files and icons in gretl A very handy feature of gretl is its sessions and icon view You can save model output and graphs for later use so you don t have to redo the same things over again Suppose you39ve just plotted some data series and also estimated a regression model Each of these actions opens a separate window in gretl If you click on the graph a menu will pop up that includes the option quotsave to session as iconquot about halfway down If you click on the quotFilequot menu in the regression model window you39ll see the same option there Once you39ve saved what you want as icons go to the main gretl menu and click on the quotViewquot menu The rst entry is quotIcon viewquot and if you choose that you39ll see the icons you just saved They39ll be labeled quotmodel 1quot and quotgraph 1quot assuming these are the rst of each you39ve done You can rename them by clicking on the icon and entering your desired title underneath you ll have to choose quotsave sessionquot before you can do this Now if you quit gretl and come back later the stuff you39ve saved will still be there You certainly don t have to do this but it could make your life simpler That should get you started I ll go over this some of it anyway in class Good luck Nonhnear regressron mode s Nonlinear regression models ECO 4305 Fall 2007 October 29 2008 Nonimear regression modeis Nonlinear relationships Test score 4 District income thuusands of dollars Nonlinear regression models Nonlinear relationships There are 2 main approaches to modeling nonlinear relationships polynomials and logarithms gt Polynomials in one or more X variables YBO31X1BQX12 3X13u gt Looks like multiple regression model chs 6 84 7 but with powers of X1 gt We can analyze this model exactly as before ie 339s ttests Ftests R2 etc gt Individual 339s don39t have simple interpretations gt Note When using R2 to compare models make sure the dependent variable is the same Nonhnear regression mode s Quadratic regression m 6073 385ncome 00423Income2 0 0048 29 027 Test Score 740 Linear regresslun 5 1 cu District income thousands of dallaxs Nonlinear regression models Polynomial regression How many terms to include What degree to use Pick maximum value say r and estimate regression Test whether coefficient on X is significantly different from 0 If so 3 7 0 stop If not 3 0 drop X and re estimate with maximum value r71 Continue until coefficient on highest power is significant NH 9quot 4 Nonimear regression modeis Regression with logarithms gt Natural logarithms of one or more X Y or both gt Review of log function Inx p 268 gt Advantage is that coefficients can be interpreted in terms of percentage changes gt Fun math fact n1X m X for small39 X gtSo nxAX 7 nX In nlt1 gt X E X gt which is the growth rate of X NOnIVnear regresgw n mode Hvi ngtd is the a pfpro Xi matiQn 213 4 5 161718 192021 2223 2425 26 27 23 percentage dung Nonlinear regression models Three logarithmic models gt Linear log model X in logs Y not Y 30 B1nXi Hi gt le changes by 1 001 Y changes by 00131 units not I gt example test score amp district income eq39n 818 Te re 5578 l 3642Inlncome gt 1 increase in income increases avg score by 036 points Nonlinear regression models Three logarithmic models gt Log linear model Y in logs X not NU139 30 51Xi Hi gt le changes by 1 unit Y changes by 10031 percent not units gt example earnings and age eq39n 820 Inermgs 2655 00086Age gt Each year of age adds 086 to earnings Nonlinear regression models Three logarithmic models gt Log log model X and Y both in logs InY 30 WNW i gt le changes by 1 001 Y changes by 31 percent gt example test scores and income again eq39n 823 In gaore 6336 l 00554Inlncome gt 1 increase in income raises avg score by 00554 percent gt Key Concept 82 p 273 Nonlinear regression models Interaction terms Nonlinear effects can also arise if the effect of one of the X39s depends on the value of another one For example gt The effect of adding a pool on a home39s selling price might depend on whether there39s a view problem 82 gt The relationship between education and earnings might depend on gender pp 284 85 problem 84 gt andor time All of these are examples of interaction terms Nonlinear regression models Interaction terms It39s not hard to allow for interaction terms in a regression Interpreting the results is also not hard but can be complicated We can have interactions based on gt two or more dummy variables gender and race party affiliation and major gt a dummy and a continuous variable gender and years of schooling HiEL and STR p 292 gt this case allows for different regressions based on the dummy variable p 280 gt two or more continuous variables STR and PctEL Nonlinear regression models Interactions 2 dummy categorical variables Example class evaluations and beauty39 gt Suppose we write down the following model Eval 30 l 31 Female l gMinority l u gt Allows for different effects for women and non whites What about non white women gt Need an interaction term Eval o l Female gMinority gFemalex Minorityu Nonlinear regression models Interactions 2 dummy categorical variables Eval 30 l 31 Female l g Minority l 33Female x Minority l u gt Group means average evaluations given by different combinations of dummy variables gt Avg for white males 50 gt Avg for nonwhite males 50 52 gt Avg for white females 50 51 gt Avg for nonwhite females 50 51 52 53 gt So is there a differential effect for minority women and a look at E82 along the way Nonlinear regression models Interactions dummy amp continuous variables Example gender gap and returns to education pp 284 85 problem 84 gt Specification in column 4 InEam77gs 122 00899Educ 7 0521Female l 00207Educ x Female l 00232Exp 7 0000368Exp2 7 003West gt All coefficients significant at 1 level gt Average earnings and effect of education on earnings both different for women than men gt In other words we have different regression lines for men amp women see fig 88 Nonimear regression modeis Regression functions implied by earnings results Men B nyr Wumen H mm innauriy earnings B7aamiiizwamism miazu yrs educatiun NonVVn ear regressw n mode Regrehssib n Functions I mplied by earnings results haur y earnings a 7 3 3 W H 12131415161718192U yreducatmn Nonlinear regression models Interactions with time dummies We can also use the same idea with dummy variables for a point in time eg years Wooldridge Introductory Econometrics third edition p 452 presents results of a similar regression using data from the 1978 and 1985 CPS surveys A lnWage 0459 l 0286y85 l 0075educ l 0006y85 x educ l 003exper 7 00004exper2 l 0198union 7 0324Female 7 0341y85 x Female l 00005 x Female x educ l 0033 x Female x y85 x educ This is a simple way to deal with panel data chapter 10 NonVVn ear regressw n mode Returns to Women s ed ucation various years 6 7 a a m M 3912 is 14 15 1E 17 m a 2n yrS39 duoaUun NonVVn ear regressw n mode Returns to educatibnvh 1978 yrsr eduoa un NonVVn ear regressw n mode Returns to educatibnvh 13998 5 yrsr eduoa un Chapter 7 Hypothesis Tests and Con dence Intervals in Multiple Regression l Solutions to Exercises 1 7264 7262 7262 a The t statistic is 546021 260 gt 196 so the coef cient is statistically signi cant at the 5 level The 95 con dence interval is 546 r 196 x 021 b t statistic is 7264020 7132 and 132 gt 196 so the coef cient is statistically signi cant at the 5 level The 95 con dence interval is 7264 r 196 x 020 3 a Yes age is an important determinant of earnings Using a t test the t statistic is 725 with a p value of 42 x 10713 implying that the coef cient on age is statistically signi cant at the 1 level The 95 con dence interval is 029 r 196 x b AAge x 029 i196 x 004 5 x 029 i196 x 004 145 i196 x 020 106 to 184 a The F statistic testing the coef cients on the regional regressors are zero is 610 The 1 critical value from the Eye distribution is 378 Because 610 gt 378 the regional effects are signi cant at the 1 level b The expected difference between Juanita and Molly is 191mma 7 gyMony x 86 86 Thus a 95 con dence interval is 7027 r 196 x 026 c The eXpected difference between Juanita and Jennifer is Xstim 7 Xstif x 85 amp1umm 7 ampJmmf x 85 755 85 A 95 con dence interval could be contructed using the general methods discussed in Section 73 In this case an easy way to do this is to omit deestfrom the regression and replace it with X5 West In this new regression the coef cient on South measures the difference in wages between the South and the deesl and a 95 con dence interval can be computed directly The tstatistic for the difference in the college coef cients is A A t collgl998 callgl992 SE collgl998 ea15571992 Because callg1998 and ed551992 are computed from independent samples they are independent which means that COW mIgum ea1575199 0 Thus var quotmllgl998 collgl992 var quotmllgl998 var quotmllgl99839 This implies that SE3 mg18 7 3 g1 0212 0202 Thus f L529 06552 There is no 0 2110 201 signi cant change since the calculated t statistic is less than 196 the 5 critical value E72 Model Regressor a b 0 Beauty 013 017 017 003 003 003 Intro 001 006 OneCredit 063 064 011 010 Female 7017 7017 005 005 Minority 7017 7016 007 007 NNEnglish 7024 7025 009 009 Intercept 400 407 407 003 004 004 SER 0545 0513 0513 R2 0036 0155 0155 fez 0034 0144 0145 a 013 r 003 x 196 or 007 to 020 b See the table above Intro is not signi cant in b but the other variables are signi cant A reasonable 95 con dence interval is 017 r 196 x 003 or 011 to 023 Time Series and forecasting Time series and forecasting ECO 4305 Dr Peter M Summers Texas Tech University November 24 2008 Time series and forecasting Time series data gt Data collected on one individual39 stock price country firm household over multiple time periods For example gt Australian economic growth unemployment rate inflation rate etc annual data from about 1860 quarterly from 1959 gt Floods of the Nile annual T m 7000 gt Real price of oil adjusted for inflation Twme semes and forecastmg Real price of WTI Crude oil Jan 1970 Sept 2008 2007 per barre El Ah ahf s9WQ 9PQW VQV 2 Time series and forecasting Why use time series data V V To make forecasts of future conditions what will the inflation rate be in 2009 To estimate dynamic causal effects if Congress passes another fiscal stimulus package what effect will this have on inflation amp unemployment in 6 months in 12 months No other option inflation unemployment etc can only be observed over time Time series and forecasting Technical issues with time series data gt Time lags previous values of Y see table 141 gt Correlation over time serial correlation or autocorrelation if inflation is high now is it likely to be high in the future gt Forecasting models based on regression gt Predicting Y using its own past autoregressive or AR models gt Predicting Y using its own past and other variable autoregressive distributed lag or ADL models gt The X variables needn39t and usually don39t have a causal interpretation gt Standard errors when data are serially correlated Time series and forecasting Lags logs and differences gt Let Yt denote the value of Y at time 1 today the most recent monthquarteryear etc Then gt V V V The rst lag of Y Y17 is the value yesterday last monthquarteryear The j th lag Yt r7 is the valuej daysmonthsquartersyears ago The rst difference of Y7 Y 7 Y1 is the change from last period to the current period Denoted AY The j th difference is AJY Y 7 YR or the change between time t 7j and time t We often work with the first log difference of Y7 An Y n Y 7 n Y17 because 100An Y is roughly the percentage growth rate of Y Time series and forecasting Autocorrelation amp autocovariance gt Covariance and correlation tell how X and Y move together gt Auto 39 versions same idea but the X39s are past Y39s gt First sample autocovariance A 1 covYtYt1 Vt 7 V Ytsl 7 V 15 Ma ll m gt First sample autocorrelation I61 covmYt1 var Yr gt Similar formulas for the jth autocorrelation Twme senes and forecastmg Example autocorrelations of inflation I ll Firs Four Sample Amorrelulioni of 0h U5 In u nn Rm and Its Change l96020IMIV Md u mus In H4 a Inaa I Alan 1 034 u 2 076 4125 3 L76 029 7003 4 067 Time series and forecasting The AR1 model gt An autoregression or autoregressive model is a regression of Yt on its past values lags gt A first orderautoregression or AR1 is a regression of Yt on its first lag Yt 30 Blytil Ut gt An ARp model includes p lags of Yt Yt BO l Blytil 32Yt72 pytip t Time series and forecasting Forecasting with AR models Example predicting the inflation rate gt AR1 model for the change in the inflation rate eq39n 147 AInft 0017 7 0238Almq1 gt Given change in inflation from August to September forecast change for October gt Use this with September39s inflation rate to forecast October inflation and real oil price Time series and forecasting Forecasting with AR models gt AR1 model using monthly data 19714 20089 m 7 000870320Alnft1 0088 0083 gt Actual change in inflation from August to September is 128 so predicted change is Alnft 70008 7 0320 128 70418 Sept to Oct gt W0 Infsept AW 70367 7 0418 70785 gt Actual blsgov 1122 dude Time series and forecasting Forecasting with AR models gt Making forecasts means making forecast errors gt One step ahead YT 7 VTH T gt Two steps ahead YT 7 VTH T gt k steps ahead YTk 7 VprkiT gt 2 measures of forecasting performance gt RMSE RMSFE Ewm 7 9mm 39 MAPE EiYT1 YT1iTiYT1 gt Other things equal lower is better Time series and forecasting Model fit and model comparison gt R275ER gt Are residuals serially uncorrelated gt Residual correogram spectrum gt Pseudo out of sample forecasts gt Estimate model over part of sample Forecast rest of sample Compute RMSE MAPE etc at various horizons Lowest wins Real time vs vintage data Time series and forecasting Information Criteria gt How to decide p in an ARp model 1 Specify maximum value say 12 estimate model test for significance of last lag drop lags until last one is significant gt Similar to polynomial regression ch 8 gt No role for parsimony 2 Akaike Information Criterion AIC Amp In m 1 3 Schwarz Bayesian Information Criterion BIC SSRp n T BICPquotlt gtp1T gt Trade off model fit for parsimony lower is better gt See table 144 Time series and forecasting Stationarity and Non stationarity b V V V So far we39ve treated time series in pretty much the same way as multiple regression ARMA ARDL models This is fine as long as the series are stationary see concept 146 p 546 Key Concept 145 p 544 Vt is stationary if the probability distribution of any sample of observations doesn39t depend on time gt This is strict stationarityquot very tough to achieve More common to work with weak stationarity Yt is weakly stationary if gt EY u doesn39t depend on time gt VarY 02 doesn39t depend on time gt CovY7 Yk ak doesn39t depend on time may depend on 0 For this class stationary39 weakly stationary Time series and forecasting Non stationary series gt Yr is non stationary if it has a trend gt Deterministic Y i lt i zytil U gt Stochastic Y Y1 u random walk Y Bo Ytsl u random walk with drift gt or a structural break gt Intercept Y o 1YH u t g 1984 Q1 Vo 1YH u t gt 1984 Q1 gt or both or lots of other ways Time series and forecasting Unit roots and stochastic trends gt AR1 model Yr 30 Blytil Ut gt Stationary if i li lt1 gt Nonstationary otherwise gt If l 1 Y has a unit root gt Unit root stochastic trend gt Test for this using the Augmented Dickey Fuller ADF test gt Estimate AV 50 6Y1 ut note 6 61 71 gt Test H0 6 0 vs H1 6 lt 0 using testatistic for 6 gt Distribution of testatistic is not Normal even in large samples Time series and forecasting Structural stability gt AR1 model Yr 30 Blytil t gt Suppose there39s a structural break at some date 30 BlYH ut t g 1984 Q1 Yt 70 V1Yt71 ut t gt 1984 Q1 ie w ampor m are not zero gt We can write this as Yt o l Yt71 y00f gt19842 l y1ytilDf gt19842 1H th where Dt gt 1984 1 1 if t gt 1984 1 Time series and forecasting Structural stability Yt o l Yt1yoDt gt 1984 l39y1Yt1Dt gt 1984 1ut gt No structural break a w 39yl 0 Test this using an F test gt This is a Chow test assumes known break date gt Suppose a break might have happened between times To amp 7391 gt What ifwe do a Chow test for each date between 70 and 71 gt What ifwe look at the biggest F statistic we get gt Then we have the QLR statistic Quandt Likelihood Ratio gt Two complications gt 70 84 7391 can39t be too close to either end of the sample typically trim39 some observations 15 on each end gt Maximum of a bunch of Fstats doesn39t have an F distribution critical values in table 146 p 568 gretl knows these too Tlme serles and forecastng Granger causality gt Suppose we have an autoregressive distributed lag ARDL or ADL model eq39n 1420 Yr o 1 Yt71 prt7p511x1 71 quotl 61q1X1J7q1 6k1Xkt71 tlquXIgtwk t gt Do past values of Xk Xkt1 7Xktqk help predict Yr That is can we reject H036k16k2 396qu07 Time series and forecasting Granger causality gt Granger causality test F test for H05k15k25qu0 gt Reject H0 Xk Granger causes Y gt Don39t reject H0 Xk does not Granger cause Y gt Caveat causality really means predictability here gt Example forecasting inflation m with lags of unemployment rate ut 7ft 30 517134 51Ut71 6t gt Rejecting H0 61 0 means u useful for forecasting n1 gt Not causality in sense of Phillips curve Time series and forecasting Aside The Likelihood Function Yr 30 let t ut N NO7 02 gt OLS gives estimates of 339s by minimizing sum of squared residuals gt Another approach is maximum likelihood estimation gt If the errors are Normally distributed then t Yt 30 51XtN N07 72 gt The pdf of Ur is 1 1 mew 7WYt 50 i 512 Time series and forecasting Aside The Likelihood Function gt The pdf of Ur is 1 1 mew 7WYt 50 i 512 gt The likelihood function is the product of these terms for each observation gt Maximum likelihood estimation MLE chooses B39s and a that give highest maximum value of likelihood function gt Linear regression get exactly the same answers for B39s gt MLE works when OLS doesn39t binary Y39s ch 11 gt Can test restrictions by comparing two values of likelihood function likelihood ratio test introduction to Econometrics Review of Probabiiity Introduction to Econometrics Review of Probability ECO 4305 Dr Peter M Summers Texas Tech University August 25 2008 lntroduction Lo Econometrics Review of Probablllty Outlines LRandom Variables Outline Sample space and events Probability distributions Describing and summarizing distributions Distributions of two or more variables Some special distributions lntroduction Lo Econometrics Review of Probablllty Outlines Lnandom sarn ling P Outline Learning about a population from a sample The sample average Distribution of the sample average The Central Limit Theorem nuoducuon Lo Economemcs Revwew of Probabmy Part I Random Variables introduction to Econometrics Review of Probability Sample space and events Random events and random variables Many events have an element of unpredictability or randomness gt Gender hair color major etc of the next person you meet gt Outcome of Tech vs AampM football game gt Will you develop cancer gt Effect on your future income from completing bachelor39s degree lntroduction to Econometrics Review of Probability Sample space and events Random events and random variables We can represent the random occurrence Will Tech beat AampM this year with the random variable Y which takes on the value 1 if Tech wins and 0 otherwise gt The sample space of Y is 01 gt The events outcomes in the sample space are 1 Tech wins and O AampM wins or ties gt The events are mutually exclusive and exhaustive Tech can either win or not and one of those has to happen gt We could write this with 3 outcomes let a tie be 0 and an AampM win be 1 gt We39re assuming the game39s actually played lntroduction Lo Econometrics Review of Probability LProbabimy distributions Loescnbmg and summarizing distributions Random variables and probability distributions There are two types of random variables gt Discrete Y can take on only a certain number of values Tech either beats AampM or doesn39t Econometrics grade major of next person you meet gt Continuous Y can take on any value average daytime high temperature average earnings of college graduates gt In either case we have to have 0 E py land n Zplyi 10F i1 00 pydy 1 700 for all possible values y lntroduction Lo Econometrics Review of Probability LProbabiliLy distributions Lpescnbmg and summarizing distributions Probability distributions and densities gt The probability of an event is given by the probability distribution if Y is discrete or probability density function or pdfif Y is continuous gt The probability that Y takes on a value no larger than y is given by the cumulative probability distribution or cumulative density function or cdf gt Example exercise 21 introduction to Econometrics Review of Probability LProbabiliLy distributions LDescnbmg and summarizing distributions Expected Values and Moments Let Y be any random variable gt The expected value or mean of Y is the population or long run average value 39 5W W gt The variance is a measure of how spread out39 the distribution of Y is gt varm EY 7 My 02y gt varm EY2 7 My gt The standard deviation is another measure of spread gt stddevY VarY a39y gt Greek letters refer to the population Back to exercise 21 Some formulas Suppose Y is discrete and can take on the values y17y27 yk with probabilities p17p27 pk gt The mean is given by EW MY p1y1 pzyz pkyk k 2PM i1 gt and the variance is VarY a P1Y1 MY2P2YZ MY2PkYk IY2 k Emmiw i1 Some formulas If Y is continuous with pdf py then gt the mean is 500 iw 0 ypydy gt and the variance is VarW 02y y2fydy 7 My lntroduction Lo Econometrics Review of Probability LProbabiliLy distributions LDescnbmg and summarizing distributions Moments If Y is any random variable discrete or continuous then EYk is called the k th moment of the distribution of Y So gt The mean is the lst moment gt The variance is the 2nd moment minus the mean squared gt The 3rd moment determines the skewness gt Skewness 0 symmetric distribution gt Skewness gt lt 0 longer right left tail gt The 4th moment determines kurtosis gt Normal distribution in a minute has kurtosis of3 gt Kurtosis gt 3 thicker tails than Normal eptokurtic distribution Figure 23 Distributions with different skewness and kurtosis i 7 m n H u M M m7 in 712iiiigi 7 o m 5mm 7 mkunum 7 3 uz Skrwnty 7 a Miran 7 23 n w i w m u uz m introduction to Econometrics Review of Probability LProbabiliLy distributions Loismbuuons of two or more variables Suppose we have 2 random variables X and Y For example X whether it rains during the TechAampM game and Y the game39s outcome Then gt thejoint distribution ofX and Y is PrX X Y yj for all different values of i and j gt Probability that it rains 84 Tech wins gt the marginal distribution of Y is PrY yJ no matter what the value of X gt Probability that Tech wins whether it rains or not gt the conditional distribution of Y is the distribution of Y when X is a particular value eg PrY yle X1 gt Probability that Tech wins if it rains lntroductlon Lo Economemcs Revlew of Probablllty LProbabmty dlstrlbutlons LDlerlbuLlons of two or more varlables gt Covariance and correlation tell how X and Y move together39 gt if they are independent then c0vX7 Y corrX7 Y O gt Weather on game day has no effect on the game39s outcome gt Usually corrX7 Y 0 does not imply independence but it does ifX and Y are Normal introduction to Econometrics Review of Probability LProbabiliLy distributions Loismbuuons of two or more variables Some examples Commuting time table 22 Earnings by education and gender box pp 36 37 Homework problem 26 Expected values and combinations of rv39s problem 25 mroducuon Lo Economemcs Revwew of Probabmy LProbabxhty dxsmbuuons LDwsmbumons of two or more vanabwes Commuting time and weather TABLE 22 Juini Dishibu an of Weather Condilions and Commuting Times Ruin x0 Na RnIn x 7 Total Lung Cuuuluuc y 0 o 13 007 022 51mm Cummuu y 1 015 063 073 Tolal D 30 070 100 lntroduction Lo Econometrics Review of Probability LProbabimy distributions LSOme special distributions Normal distribution gt The pdf of a Normal distribution is the classic bell curve39 see figure 25 given by 7 1 042044 7 We gt If Y has a normal distribution with mean uy and variance 0 we write Y Non70 gt The standard normal has uy O and 0 1 gt If Y Nuya and we define a new variable Z by Z Y 7 W7 TY then Z is standard normal that is Z NO1 See figure 26 gt The cdf of a standard normal variable Z is denoted CD Clgtc PrZ c 70 gtydy introduction to Econometrics Rewew of Probabiiity Lprobabimy distributions LSOme speciai distributions The Normal distribution noun 2 The Nunnai Pmbabilify Densin The normal probabiliiy densin mummifime and 55 1 0 a banshaped curve at u The area under We normal pd L between H 391 96crand u I 956i5 095 The normal disiribuiion is denoled Nlp 7 lntroduction Lo Econometrics Review of Probability LProbabiiiLy distributions LsOme special distributions Multivariate normal distribution If we have a collection of k normal random variables Y17 Y2 Yk that are jointly normally distributed we write Y Nu7 X In that case gt Any linear combination of the Y39s is normal gt Each marginal distribution is normal each of the Y39s is normal gt All the conditional distributions eg YllY37 are normal and gt If X is a diagonal matrix all the Y39s are independent and vice versa Basically a very convenient setup lntroduction to Econometrics Review of Probability LProbabiiity distributions LSOme special distributions Other useful distributions Some other special distributions we39ll use are gt The student t orjust 1 distribution gt Similar to normal but with thicker tails gt Described by mean variance and degrees of freedom gt The chi squared X2 and F distributions gt Both positively skewed only defined for positive numbers gt Both depend on degrees of freedom X2k Fnd gt Used extensively in hypothesis testing Normal and student t distributions nuoducuon Lo Economemcs Revwew of Probabmy Part II Random Sampling introduction to Econometrics Review of Probability Learningabout a population from a sample Random sampling gt Population is big too big to count everyone census gt So we need to rely on counting a few sample gt We want the sample to be random gt Random variable Y with some distribution gt Sample Y1 szu Yn gt Each object equally likely to be sampled gt Same distribution governs each Y gt sample is iid introduction to Econometrics Review of Probability Learningabout a population from a sample LThe sample average Sample average gt Interested in value of the population mean uy gt One possible estimator is the sample average 39 Y Ell1 Yi gt estimator is a rule for turning the sample into a number gt Example average wage of female college graduates gt Random sample ofsize n l 21i12hour box p 36 gt Different sample Y 22i36hour gt Different samples yield different estimates gt a Y is a random variable lntroduction Lo Econometrics Review of Probability earningabout a population from a sample LDrsmbuuon of the sample average Distribution of Y Suppose Y has mean uy and variance 0 and we have an iid sample of size n Then EU NY gt varY 7 m l gt Y Nome V Nomen First 2 points hold regardless of distribution of Y EJsually we can39t say anything more about the exact distribution of Y BUT we can say a lot about its approximate asymptotic distribution introduction to Econometrics Review of Probability Learningabout a population from a sample Lpimbuuon of the sample average Law of large numbers An estimator is consistent if the probability that it gets quotclose to the true population value tends to one as the sample size increases That is for any number 6 gt 07 Pruyielt VltIuyegtl as n gt 00 Equivalent statements gt V is consistent for or a consistent estimator of My gt V converges in probability to lay VTW introduction to Econometrics Review of Probabiiity The Centrai Limit Theorem The Central Limit Theorem aka Magic result making life much simpler If we have an iid sample from some some distribution with mean My and variance 0 and if 0 lt 007 then ap N071 Ty ZOWI El nuoducuon Lo Economemcs Revwew of Probabmy The Centra Lwrmt Theorem Figure 28 m 1 K rmhmm 39 Wm Mum my 39 wquot mm mm nuoducuon Lo Economemcs Revwew of Probabmy The Centra Lwrmt Theorem Figure 29 mummy I Mmh m V 4 y u mm mm M W mm Pane data mode s Panel data models ECO 4305 Dr Peter M Summers November 12 2008 Panel data models Panel data The term panel data or longitudinal data refers to a data set in which we have observations on the same units at various points in time Examples include gt Panel Study of Income Dynamics PSID Economic social amp health data on the same 8000 US families since 1968 gt National Longitudinal Surveys blsgovnls various surveys including youth NLSY79 amp NLS97 children and young adults biological children of women in NLSY79 gt Household Income and Labour Dynamics in Australia HILDA Australian survey modeled on PSID gt Medical Expenditure Panel Survey MEPS information on families individuals medical providers and employers mepsahrqgovmepsweb Panel data models Beer taxes amp vehicle fatality rates gt fatalitygdt statelevel data no Hl or AK on among other things annual traffic deaths per 10000 people and real inflation adjusted taX on a case of beer gt Policy raising beer taX should discourage consumption amp lead to fewer fatalities gt Regression of fatality rate on beer tax all states all years Panel data models Model 1 Pooled OLS estimates using 336 observations Included 48 cross sectional units Timeseries length 7 Dependent variable mrall Robust HAC standard errors Coefficient Std Error t ratio const 0000185331 117103e 05 158263 beertax 364605e 05 118255e 05 30832 Higher tax a more fatalities Panel data models State specific factors gt Western states tend to have lower traffic density so fewer deaths gt Western states may also have lower alcohol taxes gt omitted variable bias gt Cultural attitudes less acceptance of drinking may reduce consumption and therefore fatalities may be associated with higher alcohol sin tax gt Statespecific omitted variables may be hard or impossible to measure gt BUT if they don39t vary over time Panei data modeis Fixed effects model gt Basic model is Yit 30 51X 522i it 1 gt Notation gt First subscript indexes unit person firm household etc gt Second subscript t indexes time gt Z contains entity fixed effects factors that differ across states individuals firms etc but are constant over time Panel data models Fixed effects model gt Consider Texas in 1982 amp 1988 VFRTX1982 30 51 BeerTaXTX1982 52 CUIfWeTX LITX1982 VFRTX1988 30 51 BeerTaXTX1988 52 CUIfWeTX LITX1988 gt Now look at change over time subtract first equation from second AVFRTX BlABeerTaXTX AuTX where A means change from 1982 to 1988 gt So fixed effects can39t influence the change gt This formulation only works for comparing 2 years Panel data models Fixed effects model gt Statespecific intercept Yit O i leit Uit equivalent to n 7 1 dummy variables gt De meaning average Yit amp Xit over time for each state XTX 17 211 BeerTaXTXJ Then Yi 51Xit Xi it D010quot Vii leit lit gt Both give exactly the same answer for 31 de meaning more general Panei data modeis Fixed effects model gt We can also add time fixed effects Yit O i t leit Uit V t represents factors that vary over time but not by state gt Improvements in car safety airbags etc gt National laws uniform drinking age Pane data mode s unum m K pu ny Uncmp oymcm Me Pane data mode s Tune effect u 1 92a 0 893 7921 0 92 Panel data models Another example the Gradient gt Socio economic status SES eg income positively associated with health outcomes V Does better health produce higher income or vice versa V For kids causation is income a health V Significant negative relationship between family income amp poor child health found in many studies V Relationship gets more negative ie worse as kids age steepening gradient Panel data models The Gradient The Relationship between Economic Status and Child Health Evidence from the United States by Simon CondlifFe and Charles R Link American Economic Review Sept 2008 1605 1618 gt Authors use data from PSID and MEPS gt In cross sectional data ignoring panel structure how does family income affect child health status gt 5 levels of health status 1 excellent 5 poor gt Ordered probit model what39s probability of each outcome gt Exploiting the panel structure how does income affect development of new adverse health conditions Are low SES kids more likely to develop new chronic conditions eg asthma Or to recover more slowly Panel data models The Gradient gt Ordered probit sit 30 51m Yit 32411 33 Mit 54X 35 T Vit S 1 excellent health 2 very good5 poor Y family income Mi mother39s education A child39s age Xi other SES measures VVVVV Pane data mode s Ordered probit estimates nu um mm a n Gunlzlrr m m us mm mm mm ummmmommmmm atelierquot 01 4 a 1 min Number 04 nnnmuw sum 54057 5474 M w mmmuwaumm mummyme 433 42w 235 4313 lama m mm mm a an my mums zdmliml mmuymmm in mquot stsw in mv in 113 warm mum mos Luqu Nmrr mm mm mun ueln pmmw For mm nrlhr wrunmums m m w m awn mmm n ngm ca p Signi mus gee mm 5 mmrlud mm 21 I m pexzm mu mu 37m Eran9mm of ms 5mm m cm 40mm m SumLs mm mluxmdampmbxbu nullm m A36 H q Nummmmrmm um men mm wum mumm mmnm Imlamllylnmnk39y meu 439 mu mm mm mm vmn mums edmlian mumuymmm 7mm 41152quot runs mm may own way mum mun Kuhnl mm mm mmpmmwm rm onxmpmrxwmmmm mmmu Smbnc1w3mgtullxxt mm39mkz quotsmmicnmmnzs p munm Ina mpemu km ngnmnm m Pane data mode s Ordered probit estimates mu 4quot Suzyium m m me n r m 1112 vs Cwnu Emel Hmlm mus oniatdpmn x u mum Hm Num m m nbw o 1 n nanms 14306 1mm u sm vmrnn mama39s zuurzum An mHylnmml 4mm 30 45 m om mum unul wm mum mm mmmnymmm uue an mm a om u um mm m msulnmmdnmxsm H mm 0111 mm mm m Ihe gamma y vunnhks m Wu year r 53 am my mum mu m k Ilmlthtmm Wm In mum rerun 1 panm gmuml k5 puunllncl gnmmmnl u mpmm ml Panel data models The Gradient gt Panel model for new health conditions Nitt7n 0 1ln Yit 2 ln Yit X Air Tit gt an 7 of new health conditions between t 7 n and t gt Linear probability model for effect of previous conditions Pit 5o blank 52 ln Yit X Iitik 53Xit Hit gt i 1 if health status is good fair or poor poor gt 134 1 if kid i had chronic condition in year t 7 k 1997
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'