|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: AW: AW: calculation within a panel
thanks Martin. your help was precise!
2010/2/3 Martin Weiss <[email protected]>:
>
> <>
>
>
> That was supposed to be "Also note...", of course...
>
>
>
> HTH
> Martin
>
>
> -----Ursprüngliche Nachricht-----
> Von: [email protected]
> [mailto:[email protected]] Im Auftrag von Martin Weiss
> Gesendet: Mittwoch, 3. Februar 2010 15:22
> An: [email protected]
> Betreff: st: AW: calculation within a panel
>
>
> <>
>
> Also not the use of the lag operator for "growth2":
>
>
> *************
> clear*
>
> input byte( school_code ) year sch_lunch
> 1 2000 1200
> 2 2002 .
> 2 2003 400
> 2 2000 300
> 2 2001 500
> 1 2001 1300
> end
>
> compress
>
> bys school_code (year): gen growth=sch_lunch[_n]/sch_lunch[_n-1]-1
>
> tsset school_code year
> gen growth2=sch_lunch /L.sch_lunch-1
>
> list, noo
> *************
>
>
>
> HTH
> Martin
>
>
> -----Ursprüngliche Nachricht-----
> Von: [email protected]
> [mailto:[email protected]] Im Auftrag von Rodrigo Briceño
> Gesendet: Mittwoch, 3. Februar 2010 15:10
> An: [email protected]
> Betreff: st: calculation within a panel
>
> Dear Stata Users. I have a stata file with several variables for 500
> schools in years 2000-2009.
> One of this variables is the monetary allocation each school received
> for school lunch program.
> What I need is to estimate the growth rate of the allocation received
> each period, but I have no
> idea how to do that.
>
> I'm using Stata 10 and windows XP.
>
> Example:
>
> school_code year sch_lunch growth
> 1 2000 1200 na
> 2 2000 300 na
> 1 2001 1300 0.083
> 2 2001 500 0.666, etc.
>
> thanks for your help
> --
> Rodrigo Briceño
> Economist
> +506 22-91-12-00 ext. 113 Office
> +506 22-32-08-30 Fax
> [email protected]
>
> MSN: [email protected]
> SKYPE: rbriceno1087
>
> *
> * 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/
>
>
> *
> * 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/
>
>
> *
> * 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/
>
--
Rodrigo Briceño
Economist
+506 22-91-12-00 ext. 113 Office
+506 22-32-08-30 Fax
[email protected]
MSN: [email protected]
SKYPE: rbriceno1087
*
* 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/