I'm trying to create variable that is equal to the date at which the first plane is produced by the companies in my data set. And small sample is below:
input float Time long Fullid float cpn
-7305 1 .
-7274 1 .
-7245 1 .
-7214 1 .
-7184 1 .
-7153 1 .
-7123 1 .
-7092 1 .
-7061 1 .
-7031 1 .
-7000 1 .
-6970 1 .
-6939 1 .
-6908 1 .
-6880 1 .
-6849 1 .
-6819 1 .
-6788 1 .
-6758 1 .
-6727 1 .
-6696 1 .
-6666 1 .
-6635 1 .
-6605 1 .
-6574 1 .
-6543 1 .
-6515 1 .
-6484 1 .
-6454 1 .
-6423 1 .
-6393 1 .
-6362 1 .
-6331 1 .
-6301 1 .
-6270 1 .
-6240 1 .
-6209 1 35
-6178 1 68
-6150 1 111
-6119 1 177
-6089 1 249
-6058 1 319
-6028 1 390
-5997 1 466
-5966 1 539
-5936 1 619
-5905 1 695
-5875 1 770
-5844 1 845
-5813 1 895
-5784 1 949
-5753 1 995
-5723 1 .
-5692 1 .
-5662 1 .
-5631 1 .
-5600 1 .
-5570 1 .
-5539 1 .
-5509 1 .
-5478 1 .
-5447 1 .
-5419 1 .
-5388 1 .
-5358 1 .
-5327 1 .
-5297 1 .
-5266 1 .
-5235 1 .
-5205 1 .
-5174 1 .
-5144 1 .
-7305 2 .
-7274 2 .
-7245 2 .
-7214 2 .
-7184 2 .
-7153 2 .
-7123 2 .
-7092 2 .
-7061 2 .
-7031 2 .
-7000 2 .
-6970 2 .
-6939 2 .
-6908 2 .
-6880 2 .
-6849 2 .
-6819 2 .
-6788 2 .
-6758 2 .
-6727 2 .
-6696 2 .
-6666 2 .
-6635 2 .
-6605 2 .
-6574 2 .
-6543 2 .
-6515 2 .
-6484 2 .
I'm generating the variable:
Code:
gen fst_acc = 0
I tried:
Code:
replace fst_acc = Time if cpn>0
Does anyone have any advice? Thanks in advance.
0 Response to Panel data, time series: creating variable after specific entry
Post a Comment