Hi Everyone,
I am looking to create a yearly count and cumulative sum variable based on a string identifier, CUSIP. Following is the example generated by dataex:
input long patent_num int cites str8 CUSIP str4 year
3915372 16 "00003210" "1975"
3946915 37 "00003210" "1976"
3935990 20 "00003210" "1976"
3935991 17 "00003210" "1976"
4039119 12 "00003210" "1977"
4039121 19 "00003210" "1977"
5839505 34 "00036020" "1998"
5826641 24 "00036020" "1998"
5738167 10 "00036020" "1998"
So for example, for the CUSIP code 00036020, the count for patent would be 3 and the cumulative cite would be 68 (34+24+10). What should be the appropiate code to generate such count variables for inputs like patent, cites etc?
Thanks in advance!
Related Posts with Generating a yearly count variable based on a string identifier
How to calculate a confindence interval for multiple *dta file using a loop. Hi everybody!! I have downloaded 32 *.dta files of the Permanent Household Survey of Argentina th…
How do 'control units' that never receive treatment affect estimates when using time and individual fixed effects?I'm looking at the effect of fires on visits to national parks and national forests. My dataset cons…
within-group covariance by yearHi there, I would like to compute the within-firm covariance(wage_t, wage_{t-1}) for each year. I li…
Percent change with lincom?Hi, Would appreciate some help - I'm relatively new to Stata. I've done an interrupted time series…
Kappaetc weightingHi, I am currently trying to measure inter rater reliability for a set of data as below. The raters…
Subscribe to:
Post Comments (Atom)
0 Response to Generating a yearly count variable based on a string identifier
Post a Comment