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]
AW: st: RE: regression r(103): too many variables
From
"Martin Weiss" <[email protected]>
To
<[email protected]>
Subject
AW: st: RE: regression r(103): too many variables
Date
Wed, 24 Feb 2010 17:20:24 +0100
<>
" 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,
which sample code are you referring to? Mine
(http://www.stata.com/statalist/archive/2010-02/msg01122.html) works
perfectly with -varabbrev- off:
*************
clear*
set mem 500m
set obs 13700
set matsize 10000
set varabbrev off
foreach var of newlist var1-var2500{
gen byte `var'=runiform()<.3
}
gen y=rnormal()
reg y var1-var2500
*************
BTW, I consider -g- as an abbreviation for -generate- much worse than
abbreviations for variables, but that`s just me...
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Kit Baum
Gesendet: Mittwoch, 24. Februar 2010 17:06
An: [email protected]
Betreff: re: st: RE: regression r(103): too many variables
<>
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 |
http://ideas.repec.org/e/pba1.html
An Introduction to Stata Programming |
http://www.stata-press.com/books/isp.html
An Introduction to Modern Econometrics Using Stata |
http://www.stata-press.com/books/imeus.html
*
* 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/