//Building the random selection variable use nat_combined gen rand=runiform() gen select68=1 if rand<=.50 & yr2002==0 gen select02=1 if rand<=.50 & yr2002==1 save nat_combined_select, replace /*comparing the results of random sample selection to the full data sets*/ histogram age_mom if select68==1, width(1) normal graph save 3.gph, replace histogram age_mom if select02==1, width(1) normal graph save 4.gph, replace // Now let’s combine graphs from everything we’ve done and see what happens: clear cd C:\qm_data graph combine 1.gph 2.gph 3.gph 4.gph //FIN