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]

re: st: RE: regression r(103): too many variables

From   Kit Baum <>
Subject   re: st: RE: regression r(103): too many variables
Date   Wed, 24 Feb 2010 11:06:08 -0500

Paul said

in most other stats programs I've worked with, a single hyphen in a list of this type (i.e., dum_1_int_1-dum_1_int_96) would be expanded out in logical sequential fashion (i.e., dum_1_int_1 dum_1_int_2 ...).  But Stata expanded it out in the physical order in which the variables appeared in the data set 

but in Stataland, a hyphenated varlist (help varlist) ALWAYS obeys the order (help order) of the dataset, and has nothing to do with the names of the variables encompassed by that range. You can induce the behavior you want by using -order-, but it is probably safer to use wildcards -- and perhaps even the more restrictive form of wildcards with ? rather than *.

Another pet peeve of mine involves automatic variable abbreviations. I strongly suggest you 

set varabbrev off

which will cause most of Martin's sample code to fail, but will make life simpler in a number of instances.

Kit Baum   |   Boston College Economics & DIW Berlin   |
                              An Introduction to Stata Programming  |
   An Introduction to Modern Econometrics Using Stata  |

*   For searches and help try:

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