Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: generate many variables at once


From   Austin Nichols <[email protected]>
To   [email protected]
Subject   Re: st: generate many variables at once
Date   Sun, 18 Sep 2011 07:51:32 -0400

donsaane dontsi <[email protected]> :
http://www.stata.com/help.cgi?foreach
unab a: *
loc noti "i year"
loc todo: list a - noti
foreach v of loc todo {
bys i (year): g d`v'=`v'-`v'[_n-1] if year==year[_n-1]+3
}

On Fri, Sep 16, 2011 at 4:34 PM, donsaane dontsi <[email protected]> wrote:
> Hi ,
>
> I want to difference all my variables in my dataset. Is there any command to generate many variables at once? instead of doing them one by one
>
> thanks
>
> dsd
>
> *
> *   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/
>

*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index