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
Code:
post close handle
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
0 Response to How to save HR and 95%CI and P-value from Loops of cox regression from ten exposures on same outcome in a separate file (excel or dta)
Post a Comment