* * Example 4.4 * 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 * * Set a dummy which is 1 only if the year is 1988 and there is a value for scrap. * set scrap1988 = year==1988.and.%valid(scrap) set lscrap = log(scrap) * * Run the two regressions, restricting the sample only to the entries where * "scrap1988" is 1. * linreg(smpl=scrap1988) lscrap # constant grant * linreg(smpl=scrap1988) lscrap # constant grant lscrap{1}