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]
Re: st: Beginner Q: 7mil obs - how to add variables
From 
 
Richard Goldstein <[email protected]> 
To 
 
[email protected] 
Subject 
 
Re: st: Beginner Q: 7mil obs - how to add variables 
Date 
 
Tue, 08 Oct 2013 15:01:26 -0400 
not completely clear, but it looks like this will get you what you want:
egen newvar=total(Value), by(String)
Rich
On 10/8/13 2:46 PM, Coleman, Greg wrote:
> Hi 
> My data has 7 million observations and 29 variables. About 10 of the variables are string, and I am trying to get some patterns of the numerical values which are related to the strings. To clarify, 
> 
> String                    Value
> AB1234                 25
> CDE789                 44
> F9999                    126
> CDE789                 10
> AB1234                 3
> F9999                    100
> 
> I would like to get output that looks like the sum of values, per string:
> AB1234 28
> CDE789 54
> F9999 226
> 
> Some strings are just numbers, some are just letters, and some are a combination. 
> Can anyone assist?
> Thanks!
> Greg
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/