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: By: "by varlist1 (varlist2) , how to perform command by varlist2)


From   Dilip Pandey <[email protected]>
To   [email protected]
Subject   st: By: "by varlist1 (varlist2) , how to perform command by varlist2)
Date   Mon, 2 Aug 2010 14:07:31 -0500

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/


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