Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: RE: Data management


From   "Roy,Suryadipta" <suryadipta.roy@lawrence.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: RE: Data management
Date   Wed, 21 Mar 2007 13:17:56 -0500

Hi,
I am re-typing the question in order to clear up any confusion. I am actually trying to generate the last three columns (tsum, tshare1, tshare2). Their formulae are given below the data:
id year oid did dist tvol tsum tshare1 tshare2
1 2000 1 2 5 1 6 0.17 0.2
1 2000 1 3 10 1 6 0.17 0.2
1 2000 1 4 15 1 6 0.17 0.2
1 2001 1 2 5 2 4 0.5 1
1 2001 1 3 10 2 4 0.5 1
1 2001 1 4 15 2 4 0.5 1
1 2002 1 2 5 3 17 0.18 0.21
1 2002 1 3 10 3 17 0.18 0.21
1 2002 1 4 15 3 17 0.18 0.21
2 2001 2 1 5 2 4 0.5 1
2 2001 2 3 4 2 4 0.5 1
2 2001 2 4 2 2 4 0.5 1
2 2002 2 1 5 4 17 0.24 0.31
2 2002 2 3 4 4 17 0.24 0.31
2 2002 2 4 2 4 17 0.24 0.31
4 2000 4 1 15 5 6 0.83 5
4 2000 4 2 2 5 6 0.83 5
4 2000 4 3 5 5 6 0.83 5
4 2001 4 1 15 4
4 2001 4 2 2 4
4 2001 4 3 5 4
4 2002 4 1 15 10 17 0.59 1.43
4 2002 4 2 2 10 17 0.59 1.43
4 2002 4 3 5 10 17 0.59 1.43

tsum= sum of tvol for all id-s on any particular year;
tshare1= tvol/tsum;
tshare2=tvol/(tsum-tvol).

Thanks again for all your help (and sorry for the typos before).

Suryadipta.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* 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