* PS6.10, using DATA4-8, for LM test application in Example 6.7. read(data4-8) sub home inst svc tv age air y * First generate squared variables. genr sq_home=home*home genr sq_inst=inst*inst genr sq_svc=svc*svc genr sq_tv=tv*tv genr sq_age=age*age genr sq_air=air*air genr sq_y=y*y * estimate basic model and save residuals as ut ols sub home inst svc tv age air y / resid=ut * estimate auxiliary regression ols ut home inst svc tv age air y sq_home sq_inst sq_svc sq_tv & sq_age sq_air sq_y * compute LM test statistic genr LM = $n*$r2 * compute pvalue distrib LM / type=chi df=7 * from auxiliary regression add variables to basic model ols sub home inst svc tv age air y sq_home sq_age sq_air sq_y * carry out data-based model reduction ols sub home inst tv age air y sq_home sq_age sq_air sq_y ols sub home inst tv age air y sq_age sq_air sq_y ols sub home tv age air y sq_age sq_air sq_y * final model with all coefficients significant at 10 percent level ols sub home age air y sq_age sq_air sq_y * estimate most general model using the Hendry/LSE approach ols sub home inst svc tv age air y sq_home sq_inst sq_svc sq_tv & sq_age sq_air sq_y * carry out data-based model reduction on this ols sub home svc age air y sq_home sq_svc sq_tv sq_age sq_air sq_y ols sub home age air y sq_home sq_tv sq_age sq_air sq_y ols sub home age air y sq_tv sq_age sq_air sq_y * note that the final model is identical to the one above ols sub home age air y sq_age sq_air sq_y delete / all stop