Bookmark and Share

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

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

st: by prefix

From   tashi lama <>
To   <>
Subject   st: by prefix
Date   Mon, 4 Jun 2012 14:35:00 +0000


  Here is sth I found Stata very unintelligent. A by prefix has to be preceded by sort command although the dataset is already sorted by design. Take a look at this


var1    var2

A         3

A         4 

A         1

B         2

B         5



The dataset is already sorted by var1 as you all can see. Now when I apply by prefix

by var1: summ var2    says not sorted. 

Stata obliges you to write 

bysort var1: summ var2    which I think is overkill. Any thoughts?





*   For searches and help try:

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