Hi all,
I am trying to generate the growth rate in a variable by a monthly date (modate or modate2, either works). I want to see the growth, for instance, between share_mandated_month in month 635 to month 636. I have tried bys modate2: g growthrate=(share_mandated_month[_n]-share_mandated_month[_n-1])/share
> _mandated_month[_n-1] but it just gives me 0 for all values. I know that I have lots of observations of a month, but still want every observation to just show the growth rate between that month and the last for the growth rate variable.
I am trying to generate the growth rate in a variable by a monthly date (modate or modate2, either works). I want to see the growth, for instance, between share_mandated_month in month 635 to month 636. I have tried bys modate2: g growthrate=(share_mandated_month[_n]-share_mandated_month[_n-1])/share
> _mandated_month[_n-1] but it just gives me 0 for all values. I know that I have lots of observations of a month, but still want every observation to just show the growth rate between that month and the last for the growth rate variable.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(modate modate2 share_mandated_month) 635 56 .6012899 635 56 .6012899 635 56 .6012899 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 636 57 .54626864 end format %tm modate
Comment