* Piecewise OLS Model for Total Cost * * Keywords: * regression, ols, linear, dummy, interaction, piecewise, total cost * * Description: * We illustrate how to estimate a Piecewise OLS Model for Total Cost * * Author(s): * Skif Pankov * * Source: * Damodar N. Gujarati and Dawn C. Porter, Basic Econometrics - 5th Edition * McGraw-Hill International Edition, Chapter 9, Example 9.7 (page 297) * sample 1 10 * Reading the datafile and naming variables read(data_9.7.shd) tc out * Generating dummy interaction variable dout1 from a modified variable out * and from a dummy d indicating that the output is higher than 5000 units genr out1 = out - 5500 genr d = (out.ge.5500) genr dout1 = d*out1 * Running an OLS regression of tc on out and dout1, stating to include * residual statistics ols tc out dout1 / rstat stop