************************************************************** * tlc-naive.do * ************************************************************** * * * PURPOSE: analysis of the TLC trial data * * * * AUTHOR: P. Heagerty * * * * DATE: 28 March 2007 * ************************************************************** infile id str5 tx y0 y1 y4 y6 using tlc-raw.txt *** *** derive treatment indicator *** gen txOld = tx gen succimer = (tx=="A") drop tx gen tx = succimer reshape long y, i(id) j(week) *** create some time variables gen wk0 = (week==0) gen wk1 = (week==1) gen wk4 = (week==4) gen wk6 = (week==6) gen post = (week>0) gen weekXtx = week * tx gen wk1Xtx = wk1 * tx gen wk4Xtx = wk4 * tx gen wk6Xtx = wk6 * tx *** Analysis using POST DATA at weeks 4 and 6 regress y tx if week>=1 regress y tx if week>=1, cluster(id) *** Analysis using PRE/POST for treatment subjects regress y post if tx==1 regress y post if tx==1, cluster(id)