Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: RE: By: "by varlist1 (varlist2) , how to perform command by varlist2)


From   Dilip Pandey <dpandey1@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: By: "by varlist1 (varlist2) , how to perform command by varlist2)
Date   Mon, 2 Aug 2010 15:30:52 -0500

Martin,
Thank you so much. Nick's article addressed my question.
Dilip

On Mon, Aug 2, 2010 at 3:09 PM, Dr. Martin Weiss <martin.weiss1@gmx.de> wrote:
>
> <>
> To be honest, I do not understand your question. Maybe you can give a concrete example. In the meantime, note that -bysort- can perform the -sort- operation for you. Also read up on the whole issue in NJC`s http://www.stata-journal.com/sjpdf.html?articlenum=pr0004
>
>
>
> HTH
> Martin
>
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Dilip Pandey
> Sent: Montag, 2. August 2010 21:08
> To: statalist@hsphsun2.harvard.edu
> Subject: st: By: "by varlist1 (varlist2) , how to perform command by varlist2)
>
> Dear Statalist;
> I am STATA 11 user.
> I have sorted my data as -
>
> sort varlist1 (varlist2) (varlist3) (varlist4)
>
> Now I want to perform STATA command: thru_dt[_n+1) - from_dt[_n] by
> varlist2 (not varlist1, keeping sort order performed earlier)
> with STATA command:
>
> by varlist1 (varlist2): gen x = thru_dt[_n+1) - from_dt[_n]
> STATA verifies that data are sorted by varlist 1 varlist2 and performs
> command by varlist1.
>
> I will highly appreciate suggestion on "How to perform STATA command
> for varlist2 in above situation.
> Thanks.
> Dilip
> *
> *   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/
>

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index