use "/Users/dave/UCSF/Teaching/Teaching20/HW7/hwk7.dta", clear logistic hepatom female edema bilir copper ast age predict out, p xtile group=out, nq(5) tab group hepat logistic died i.hepatom i.group margins hepatom margins, dydx(hepatom) logistic died i.hepatom female edema bilir copper ast age margins hepatom gen pw= 1/out if hepatom==1 replace pw = 1/(1-out) if hepatom==0 logistic died i.hepatom [pweight=pw] margins hepatom graph box pw replace pw=13 if id==63 | id==281 logistic died i.hepatom [pweight=pw] margins hepatom