cd C:\Users\smendoli\Dropbox\Torino new\Panel data course\Data to create a panel" **How to create a panel (using two waves here, you can use as many as you want/have) foreach j in a b { use `j'_indresp_test, clear renpfix `j'_ // Strip off wave prefix // Now select variables needed keep pidp hidp dvage sex birthy save indiv`j', replace } use indiva g wave=1 save, replace use indivb g wave=2 save, replace use indiva append using indivb save panel, replace sort pidp wave br **How to merge the individual file and the household file use a_indresp_test sort a_hidp merge m:1 a_hidp using a_hhresp_test ta _merge drop if _merge==2 drop _merge save wave1_complete