* do-file for Supplementary Exercise 2.53 version 13 /* works also with version 14 */ import delimited "H:\VHM\VHM801\Datasets\csv\Chapter 2\ex02_053.csv" scatter vein spheres twoway (scatter vein spheres) (lfit vein spheres) regress vein spheres * one method to obtain predictions for x-values not in the dataset * is to insert new observations (leaving the y-value as missing) * either using the edit window, or using commands like the following: set obs 13 replace spheres=6 in 11 replace spheres=12 in 12 replace spheres=18 in 13 * now, the prediction is done in the same way as before predict fit, xb predict pe_fit, stdf scalar tstar=invttail(8,.025) generate pe_low=fit-tstar*pe_fit generate pe_upp=fit+tstar*pe_fit list in 11/13, separator(5)