Mark and Vincent, thanks a lot for your help!
I am running the code that Vincent has provided but it stops at the following point:
. tokenize `varlist'
. local i 1
. while "``i''" != "" {
2. qui by `id': gen double mean`i' = sum(``i'') / _n
3. qui by `id': replace mean`i' = mean`i'[_n]
4. qui by `id': gen double diff`i' = ``i'' - mean`i'
5. local newlist `newlist' mean`i' diff`i'
6.
. local i = `i' 1
7. }
if not found
r(111);
end of do-file
r(111);
I can't find the error. Could you please help me?
Thank you a lot,
Paula
_________________________________________________________
http://www.latinmail.com. Gratuito, latino y en espa�ol.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/