log using Drugstudy2.log,text replace use DrugStudy,clear codebook,comp ******************************************* * DrugStudy.dta is on Long format * i.e. there are one line/row for each * patient week*combination * sometime we would like to have data * on a WIDE format that is with one * row for each patient * this done by the reshape command ******************************************* list if pid==1 reshape wide score,i(pid) j(week) *cheking that all vent well list if pid==1 browse save DrugStudyWide,replace ****************************************** * if want to go from WIDE to LONG then * do like this ****************************************** use DrugStudyWide,clear list if pid==1 reshape long score,i(pid) j(week) *cheking that all vent well list if pid==1 browse save DrugStudyLong,replace log close