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.
REGHDFE Coefplot graphing mistakeI'm having a little trouble graphing coefplot. My regression is using reghdfe command and I'm simply…
Interpolation Method: panel data setHello, I show you an example of the dataset that I have: Code: * Example generated by -dataex-. …
Remove estimated parameters from Stata result windowHi All, just a quick question. I am estimating a model containing a lot of dummies, which I use as …
Compare variable in two stata files and listI have two datasets and I want to make sure that the same IDnumber has not been recorded twice in th…
Compatibility of Stata 16 and Stata 17 outputs?At my academic workplace I have Stata 16 MP (16.0, not updated -- long story, endless fights with th…
Subscribe to:
Post Comments (Atom)
0 Response to Growth rates from Panel dataset.
Post a Comment