/* Produce Confidence Intervals p. 60 */ quietly { log using confint, smcl replace regress sbp age predict se_ci, stdp /* SE for confidence interval around Y */ predict se_pi, stdf /* SE for prediction interval around Y */ predict yhat, xb /* Predicted or expected values */ display invttail(e(df_r),(.05/2)) /* Determine t-critical */ generate ll_ci=yhat-(se_ci*2.0484071) /* Create the lower and upper limits */ generate ul_ci=yhat+(se_ci*2.0484071) generate ll_pi=yhat-(se_pi*2.0484071) generate ul_pi=yhat+(se_pi*2.0484071) format sbp yhat se_ci ll_ci ul_ci ll_pi ul_pi %9.4f noisily di _n "Inferences ABout the Regression Line (pp. 59-61)" noisily di _n "Regression of SBP(Y) on Age (X)" noisily list id sbp yhat se_ci ll_ci ul_ci ll_pi ul_pi, noobs /* What does it look like? pp. 58-59 */ drop se_ci- ul_pi log close view confint.smcl }