panel data manipulation
Posted: Wed Feb 16, 2011 1:41 pm
Using 7.1
I am trying to create a series which calculates and stores the cumulative sum of a variable (QTY) for each and every quarter. I am using an unbalanced panel data set comprised of multiple projects in each quarter. Trying to the sum QTY across projects in each quarter and store the sum for each quarter in a seperate series. Have tried the following but....
if test>=4/1/2006 and test <7/1/2006
series total=@cumsum(qty)
smpl @all
if test>=7/1/2006 and test <10/1/2006
series total=@cumsum(qty)
smpl @all
TEST QTY
4/1/2006 8430
4/1/2006 991
4/1/2006 27200
4/1/2006 650
4/1/2006 8350
4/1/2007 1091
4/1/2007 7220
4/1/2007 13500
7/1/2007 8000
7/1/2007 2800
7/1/2007 9400
7/1/2007 6800
7/1/2007 300
4/1/2008 15067
4/1/2008 15067
7/1/2008 8546
7/1/2008 8546
10/1/2008 236
I am trying to create a series which calculates and stores the cumulative sum of a variable (QTY) for each and every quarter. I am using an unbalanced panel data set comprised of multiple projects in each quarter. Trying to the sum QTY across projects in each quarter and store the sum for each quarter in a seperate series. Have tried the following but....
if test>=4/1/2006 and test <7/1/2006
series total=@cumsum(qty)
smpl @all
if test>=7/1/2006 and test <10/1/2006
series total=@cumsum(qty)
smpl @all
TEST QTY
4/1/2006 8430
4/1/2006 991
4/1/2006 27200
4/1/2006 650
4/1/2006 8350
4/1/2007 1091
4/1/2007 7220
4/1/2007 13500
7/1/2007 8000
7/1/2007 2800
7/1/2007 9400
7/1/2007 6800
7/1/2007 300
4/1/2008 15067
4/1/2008 15067
7/1/2008 8546
7/1/2008 8546
10/1/2008 236