Yes, good improvement.
Nick
[email protected]
Scott Merryman
> Another slight simplification would be move the -levelsof- outside the
> loops.
>
> su group, meanonly
> local max = r(max)
> levelsof bvd_id_number, local(levels)
> forvalues i=1/`max' {
> ....
Nick Cox
> > A further simplification to your code is
> >
> > su group, meanonly
> > forvalues i=1/`r(max)' {
> > levelsof bvd_id_number, local(levels)
> > foreach l of local levels {
> > forval k = 1/`year_count' {
> > replace gamo = gamo + (tax[_`l']-
> > tax[_`k'])*ratio_assets[_`k'] ///
> > if bvd_id_number==`l'
> > }
> > }
> > }
*
* 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/