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.
Invalid name error in foreach loopHi, I'm having trouble in running a foreach loop and it keeps showing the invalid name error to me. …
Choosing random group member observation in the presence of missing valuesDear all: I have a data set that looks roughly like this, i.e. individuals in groups. For most but …
How to estimate a Diff-in-Diff with this longitudinal data structure?Dear Statalist, I am interested in implement a diff-in-diff (DID) analysis for the following longit…
plots for restracted cubic spline 5 knotes for linear mixed model after mutiple imputationCould any members give me some advice about how to plot a curve of blood pressure against age as the…
Mergin data from Global Entrepreneurship Monitor (GEM)Dear All, I am quite new to STATA and need your help. I am currently doing my master thesis and wou…
Subscribe to:
Post Comments (Atom)
0 Response to Growth rates from Panel dataset.
Post a Comment