Statalist


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

Re: st: AW: AW: calculation within a panel


From   Rodrigo Briceño <rjbriceno@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: AW: AW: calculation within a panel
Date   Fri, 5 Feb 2010 10:18:02 -0600

Thanks for your help Martin. The command worked perfectly.

2010/2/3 Martin Weiss <martin.weiss1@gmx.de>:
>
> <>
>
>
> That was supposed to be "Also note...", of course...
>
>
>
> HTH
> Martin
>
>
> -----Ursprüngliche Nachricht-----
> Von: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Martin Weiss
> Gesendet: Mittwoch, 3. Februar 2010 15:22
> An: statalist@hsphsun2.harvard.edu
> 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: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Rodrigo Briceño
> Gesendet: Mittwoch, 3. Februar 2010 15:10
> An: statalist@hsphsun2.harvard.edu
> 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
> rjbriceno@gmail.com
>
> MSN: jbric98@hotmail.com
> 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
rjbriceno@gmail.com

MSN: jbric98@hotmail.com
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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index