 global knotstvc_opt
 global bknotstvc_opt
{\smallskip}
 foreach cause in cancer other cvd {\lbr}
  2.   global lnbhknots_`cause'
  3. {\rbr}
{\smallskip}
 foreach cause in cancer other cvd {\lbr}
  2.   stpm2 mostdep sex rcsage? if _`cause'==1, df(3) /// 
  >       tvc(mostdep sex rcsage?) dftvc(2) scale(h) eform
  3.   global bhknots_`cause' `e(bhknots)'
  4.   global boundknots_`cause' `e(boundary_knots)'
  5.   foreach cov in mostdep sex rcsage1 rcsage2 rcsage3 {\lbr}
  6.      global knotstvc_opt ${\lbr}knotstvc_opt{\rbr} ///
  >          `cov'_`cause' `e(tvcknots_`cov')'
  7.   {\rbr}
  8.   global knotstvc_opt ${\lbr}knotstvc_opt{\rbr} _`cause' ${\lbr}bhknots_`cause'{\rbr}
  9.   global bknotstvc_opt ${\lbr}bknotstvc_opt{\rbr} _`cause' ${\lbr}boundknots_`cause'{\rbr}
 10. {\rbr}
