window push log using FramSBPbmiMulti.log, replace window push * FramSBPbmiMulti.log window push * window push * Framingham data set: Multiple regression analysis of effect of bmi on sbp window push * window push set more on window push use "2.20.Framingham.dta", clear window push regress sbp bmi window push scatter sbp bmi, msymbol(Oh) /// window push || lfit sbp bmi, ytitle(Systolic Blood Pressure) window push more window push regress sbp age window push scatter sbp age, msymbol(Oh) /// window push || lfit sbp age, ytitle(Systolic Blood Pressure) window push more window push regress sbp scl window push scatter sbp scl, msymbol(Oh) /// window push || lfit sbp scl, ytitle(Systolic Blood Pressure) window push more window push graph matrix sbp bmi age scl if month==1 & sex==2 , msymbol(oh) window push more window push * window push * Use multiple regression models with interaction terms to analyze window push * the effects of sbp, bmi, age and scl on sbp. window push * window push generate woman = sex -1 window push label define truth 0 "False" 1 "True" window push label values woman truth window push generate agewoman = age*woman window push generate bmiwoman = bmi*woman window push generate sclwoman = scl*woman window push regress sbp bmi age scl woman bmiwoman agewoman sclwoman window push regress sbp bmi age scl woman bmiwoman agewoman window push regress sbp bmi age scl woman agewoman window push * window push * Fit a model of sbp against bmi age scl and sex with window push * interaction terms. The variables woman, bmiwoman, window push * agewoman, and sclwoman have been previously defined. window push * window push stepwise, pe(.1): regress sbp bmi age scl woman bmiwoman agewoman sclwoman window push more window push stepwise, pr(.1): regress sbp bmi age scl woman bmiwoman agewoman sclwoman window push more window push predict yhat, xb window push predict res, rstudent window push lowess res yhat, bwidth(0.2) msymbol(oh) color(gs10) lwidth(thick) /// window push yline(-1.96 0 1.96) ylabel(-2 (2) 6) ytick(-2 (1) 6) /// window push xlabel(100 (20) 180) xtitle(Expected SBP) window push more window push * window push * Illustrate influence of individual data points on window push * the parameter estimates of linear regression. window push * window push drop res window push keep if id > 2000 & id <= 2050 window push regress sbp bmi age scl woman agewoman, level(50) window push predict res, rstudent window push predict cook, cooksd window push label variable res "Studentized Residual" window push label variable cook "Cook's Distance" window push scatter cook res, ylabel(0 (.1) .5) xlabel(-2 (1) 5) window push list cook res id bmi sbp if res > 2 window push regress sbp bmi age scl woman agewoman if id ~= 2049, level(50) window push log close