Hi there
In the above command, the matrix only stores the last regression, in this case where surgery==1 & posttran==1, whereas my aim is to store all of them in separate matrices (which I can then put into Excel).
I could run a long series of conditional commands but this is not a very satisfactory option (especially when the "by" variables could take a higher/changeable number of values).
I'd be grateful if anyone could suggest a more elegant solution (perhaps as a loop?).
Code:
use http://www.stata-press.com/data/r13/stan3, clear stset t1, failure(died) id(id) bysort surg posttran: stcox age year matrix results = r(table) matlist results
I could run a long series of conditional commands but this is not a very satisfactory option (especially when the "by" variables could take a higher/changeable number of values).
I'd be grateful if anyone could suggest a more elegant solution (perhaps as a loop?).
Comment