window push version 8.0 window push set more on window push log using 3.11.1.Framingham.log, replace window push * 3.11.1.Framingham.log window push * window push * Plot a scatterplot matrix of log(sbp), log(bmi), age and log(scl) for window push * women from the Framingham Heart Study who were recruited in January. window push * window push use 2.20.Framingham.dta window push generate logsbp = log(sbp) window push label variable logsbp "Log Systolic Blood Pressure" window push generate logbmi = log(bmi) window push label variable logbmi "Log Body Mass Index" window push generate logscl = log(scl) window push label variable logscl "Log Serum Cholesterol" window push set textsize 120 window push graph matrix logsbp logbmi age logscl if month==1 & sex==2, msymbol(Oh) /// window push mcolor(gs10) window push more window push * window push * Use multiple regression models to analyze the effects of log(sbp), window push * log(bmi), age and log(scl) on log(sbp) window push * window push generate woman = sex - 1 window push generate wo_lbmi = woman * logbmi window push generate wo_age = woman * age window push generate wo_lscl = woman * logscl window push regress logsbp logbmi age logscl woman wo_lbmi wo_age wo_lscl window push regress logsbp logbmi age logscl woman wo_lbmi wo_age window push regress logsbp logbmi age logscl woman wo_age window push * window push * Calculate 95% confidence and prediction intervals for a 60 year-old window push * woman with a SCL of 400 and a BMI of 40. window push * window push edit window push set obs 4700 window push replace scl = 400 in 4700 window push replace age = 60 in 4700 window push replace bmi = 40 in 4700 window push replace woman = 1 in 4700 window push replace id = 9999 in 4700 window push replace logbmi = log(bmi) if id == 9999 window push replace logscl = log(scl) if id == 9999 window push replace wo_age = woman*age if id == 9999 window push predict yhat,xb window push predict h, leverage window push predict std_yhat, stdp window push predict std_f, stdf window push generate cil_yhat = yhat - invttail(4658-5-1,.025)*std_yhat window push generate ciu_yhat = yhat + invttail(4658-5-1,.025)*std_yhat window push generate cil_f = yhat - invttail(4658-5-1,.025)*std_f window push generate ciu_f = yhat + invttail(4658-5-1,.025)*std_f window push generate cil_sbpf = exp(cil_f) window push generate ciu_sbpf = exp(ciu_f) window push list bmi age scl woman logbmi logscl yhat h std_yhat std_f cil_yhat /// window push ciu_yhat cil_f ciu_f cil_sbpf ciu_sbpf if id==9999 window push display invttail(4652,.025) window push * window push * Repeat the preceding analysis using an automatic forward window push * selection algorithm window push * window push drop if id == 9999 window push sw regress logsbp logbmi age logscl woman wo_lbmi wo_age wo_lscl, forward pe(.1) window push * window push * Draw a scatterplot of studentized residuals against the estimated expected window push * value of logsbp together with the corresponding lowess regression curve. window push * window push predict t, rstudent window push lowess t yhat, bwidth(0.2) msymbol(Oh) mcolor(gs10) clwidth(thick) /// window push ylabel(-3(1)5) yline(-1.96 0 1.96) xlabel(4.7(.1)5.1) window push more window push generate out = t > 1.96 | t < -1.96 window push tabulate out window push * window push * Perform an influence analysis on patients 2000 through 2050 window push * window push keep if id >= 2000 & id <= 2050 window push regress logsbp logbmi age logscl woman wo_age window push drop t h window push predict h, leverage window push predict z, rstandard window push predict t, rstudent window push predict deltab1, dfbeta(logbmi) window push predict cook, cooksd window push display invttail(43,.025) window push label variable deltab1 "Delta Beta for log[BMI]" window push scatter deltab1 t, msymbol(Oh) ylabel(-1.5(.5)0, angle(0)) yline(0) /// window push xlabel(-2(1)4) xtick(-2.5(.5)4.5) xline(-2 2) window push sort t window push list id h z t deltab1 cook in -3/-1 window push regress logsbp logbmi age logscl woman wo_age if id ~=2049 window push display ( .1659182 - .3675337 )/.1489199 window push log close