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]

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


From   "Dr. Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: RE: By: "by varlist1 (varlist2) , how to perform command by varlist2)
Date   Mon, 2 Aug 2010 22:09:06 +0200

<>
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: [email protected] [mailto:[email protected]] On Behalf Of Dilip Pandey
Sent: Montag, 2. August 2010 21:08
To: [email protected]
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/


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