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 on April 23, and its replacement, is already up and running.

[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 <>
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.
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index