* * Example 7.7 * J. Wooldridge, Econometrics of Cross Section and Panel Data * * Note: The sample data files include all required data transformations. * However, in many cases we show how these data transformations would * be created in RATS from the basic data, as this is something you will * need to know how to do in practice. * cal(panelobs=3) 1987 all 157//3 open data jtrain1.raw data(format=free,org=columns) / year fcode employ sales avgsal scrap rework $ tothrs union grant d89 d88 totrain hrsemp lscrap lemploy lsales lrework lhrsemp $ lscrap_1 grant_1 clscrap cgrant clemploy clsales lavgsal clavgsal cgrant_1 chrsemp clhrsemp * * These aren't really necessary, as they're included in the complete data set, but * these show how they would be generated in RATS from the basic data. * set allthree = %valid(scrap(%indiv(t)//1)+scrap(%indiv(t)//2)+scrap(%indiv(t)//3)) set d89 = %period(t)==3 set d88 = %period(t)==2 set lscrap = log(scrap) * * If you use the RATS lag notation for the lag of grant, it will knock out all * 1987 data points, since grant{1} will be pre-sample. However, the value of that * lag is known to be zero for all data points, so we create a separate value * which is 0 for all 1987 data points, and the lag of grant otherwise. * set grant_1 = %if(%period(t)==1,0,grant{1}) * linreg lscrap # constant d88 d89 grant grant_1