Hi, I am recently working on a project that requires me to calculate the HRs and 95%CI and p-value for ten separate exposures on the same outcomes. So, I used the loops:
Code:
 
 stset tdeath, failure(death==1) capture postutil clear tempfile results postfile handle str32 variable float(hr lb ub) using `results'  foreach var of varlist systolicbp distolicbp{     stcox `var' age sex     matrix M = r(table)     post handle ("`v'") (M[1, 1]) (M[5, 1]) (M[6, 1]) } post close handle use `results', clear
Then I got the outputs results for two Cox model on exposures of "systolicbp" and "distolicbp" separately, But I got error message when running
Code:
post close handle
it said "post close not found".

My question is that could anyone suggest codes for saving the HRs, 95%CI lower upper and the p-value from the loop of Cox regressions on a separate file either excel or dta? May thanks!

All the best,

Roth