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.
Extracting dummy regression coefficients using statsbyI have the dataset shared further below. I need to: a) run several regressions whereby a continuous …
The best model for a multilevel dataset with a small number of clustersDear all, I have a three-level cross-country survey data that is not panel. The levels are country…
Probem with using global macro in a string before an underscoreHi statalisters, I want to use global macro's to refer to folder names, but ran into some unexpecte…
Latent Class Analysis: Vermunt 3-step procedure for estimating distributions of external variables?Has anyone implemented, or know of an approach, to implementing the 3-step ML method for estimating …
Survival analysis using flexible parametric models to account for time-varying hazards (stpm2)Dear Statalisters, My question relates to survival analysis in the presence of time-varying hazards…
Subscribe to:
Post Comments (Atom)
0 Response to Growth rates from Panel dataset.
Post a Comment