Statalist


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

st: Summing across variables


From   "John Pfaff" <jpfaff@law.fordham.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Summing across variables
Date   Tue, 06 Oct 2009 15:51:40 -0400

Hello,

I am trying to create a fast way to generate a new variable that is the sum of a lot of variables. Obviously varnew = var1 + var2 + var3 works, but I have to think there is a better way, since I may have up to 50 or 100 variables across which I want to sum. Handtyping that out seems inefficient, and I'd like the flexibility of being able to vary the number of variables I'm summing across easily. Thanks so much for any suggestions!

All the best,

John

Associate Professor of Law
Fordham University School of Law
140 West 62nd Street
New York, New York 10023
Phone:  (212) 636-7661
Fax:       (212) 636-6899
E-mail:    jpfaff@law.fordham.edu

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index