* do-file for Supplementary Exercises 2.11, 2.48, 10.38 and 10.39 of IPS7e version 13 /* works also with version 14 */ import delimited "H:\VHM\VHM801\Datasets\csv\Chapter 2\ex02_011.csv" scatter hav ma pwcorr hav ma, sig twoway (scatter hav ma) (lfit hav ma) regress hav ma * Stata does not give a prediction interval but it can be computed * from the fitted value, the prediction ("forecast") error and the t-percentile * To get the values for MA=25, look for an observation with that value! predict fit, xb predict pe_fit, stdf * our t-star value display invttail(36,0.025) generate pi_lower = fit - invttail(36,0.025)*pe_fit generate pi_upper = fit + invttail(36,0.025)*pe_fit * analyses without the suspected outlier pwcorr hav ma if hav<50, sig regress hav ma if hav<50