Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: RE: How to create sum of variables by time and space

From   Nick Cox <>
To   "''" <>
Subject   st: RE: How to create sum of variables by time and space
Date   Wed, 8 Jun 2011 18:39:40 +0100

. help egen 


Ahmedov, Zafarbek

I'm using Stata 11. I have a data table with 5 variables (columns)and over 500,000 observations. Two of them are time (Year, Month) variables and one location (Location) variable. I am trying to get the sum of the other two variables (Tons, Number_of_Barges) by location and time. 

I tried to sort the data and get the summary statistics, but it didn't produce the desired result. I typed the following codes:

sort location year month
by location year month: summarize(Tons Number_of_Barges)

The problem with this code is, it didn't give the totals. I would greatly appreciate if you can offer any help or advise.

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index