clear set more off cd "~/Documents/teaching/c2015/biostat208/labs/lab7" * do "~/Documents/teaching/c2015/biostat208/labs/lab7/lab7.do" capture log close log using lab7, replace use lab7, clear * a priori model regress bmd eeu age lweight i.estrogen calsupp diuretic etid momhip usearms /// gs10 gaitspd poorhlth caffeine drnkspwk smoker * cic model selection cic, model(regress) outcome(bmd) primary(eeu) /// alist(age lweight i.estrogen calsupp diuretic etid momhip) /// blist(usearms i.tandstnd has10 gs10 gaitspd poorhlth caffeine drnkspwk smoker) lincom eeu*1.5 lincom eeu*1.5/0.73*100 lincom 2.estrogen nlcom _b[lweight]*log(1.1) cic, model(regress) outcome(bmd) primary(eeu) /// alist(age lweight i.estrogen calsupp diuretic etid momhip) /// blist(usearms i.tandstnd has10 gs10 gaitspd poorhlth caffeine drnkspwk smoker) /// complete cic, model(regress) outcome(bmd) primary(eeu) /// alist(age lweight i.estrogen calsupp diuretic etid momhip) /// blist(usearms i.tandstnd has10 gs10 gaitspd poorhlth caffeine drnkspwk smoker) /// criterion(10) * backwards: xi: sw, lockterm1 pr(0.2): /// regress bmd (eeu age lweight i.estrogen calsupp diuretic etid momhip) /// usearms (i.tandstnd) has10 gs10 gaitspd poorhlth caffeine drnkspwk smoker * Allen Cady procedure: xi: sw, lockterm1 pr(0.2) hier: /// regress bmd (eeu age lweight i.estrogen calsupp diuretic etid momhip) /// usearms (i.tandstnd) has10 gs10 gaitspd poorhlth caffeine drnkspwk smoker * stepwise models with retention criteria of 0.2, 0.1, and 0.05 foreach pr in 0.2 0.1 0.05 { di _newline as result "Backwards deletion with a retention criterion of p<`pr'" xi: sw, lockterm1 pr(`pr'): /// regress bmd (eeu age lweight i.estrogen calsupp diuretic etid momhip) /// usearms (i.tandstnd) has10 gs10 gaitspd poorhlth caffeine drnkspwk smoker } * backwards selection model omitting tandem stand and hip abductor strength xi: sw, lockterm1 pr(0.2): /// regress bmd (eeu age lweight i.estrogen calsupp diuretic etid momhip) /// usearms gs10 gaitspd poorhlth caffeine drnkspwk smoker log close