Professor Baum, thank you very much for your help.
Your example worked perfectly. I am now very motivated to learn mata and adapt your sequence to my case (using existing variables in different datasets rather than creating new ones) and create an ado file. It will take a while, but it will definitely worth it.
In debt,
Andrés González Rangel
Epidemiology Graduate Student
Colombia
_________________________________________________________________
Hotmail: Free, trusted and rich email service.
http://clk.atdmt.com/GBL/go/171222984/direct/01/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/