Hi Statalist,
I have a panel dataset (monthly survey responses) which is defined by a firm id variable and a monthly time variable (format example: 2021m1) and has around 30 variables total. One of these variables are current firm sales. I'm looking to generate a new variable that calculates firm yearly sales growth rates from that current sales variables with the firms that have responses that are 12 months apart. For those firms that don't have responses 12 months apart, this variable would just be a dot so that these observations can be dropped later. I've used tsset FIRM_ID mdate to be able to use the time series operators but am not sure where to go from here.
I've used dataex to show a sample of my data below, however the mdate column has been converted to numbers (e.g. 748) but in my data editor it's under the format 2021m1.
input long FIRM_ID float(C_SALE mdate)
38 1.40e+07 748
100 3.50e+08 747
210 2850000 758
337 60000 746
563 3000000 744
799 3.50e+07 754
1258 629927 755
1612 150000 756
1638 75000 751
1936 300 752
Best,
Matt
Related Posts with Growth rates from Panel dataset.
cap file commandsHi all I have a problem with the following code (I got it by a colleague...): use "${logpath}\cou…
Panel dataset of Matched sample using rangejoinDear Statalisters, I want to see the effect of a law which came into effect on 1975 on the lnpatent…
PercentilesHi everyone, I have three variables - ProductCode, Year and PRODY. (Sample given below) ProductC…
Advice regarding Ramsey RESET test resultHello, I'm running an OLS regression with around 2000 observations and a few variables - most of th…
Date precisionIf I do this: . gen double d=clock("20200101 01:01:01", "YMD hms") . format %tC d . browse then …
Subscribe to:
Post Comments (Atom)
0 Response to Growth rates from Panel dataset.
Post a Comment