Dear Statalist,
How can I compute a new variable with the sum of observations per year and company: I want to find a way to aggregrate all distinct patents in a sample of n=1000000 approx to the year and firm, such that firm A has number of patents B in year Y and number of patents C in year Z, and so forth.
In this case, the number 9 under 'totaloutput' is the only number I want to keep because the data tells me there are 9 patents created by firm 3D SYS INC in 1996. from this data i only want to know the total amount of patents a firm has produced in a given year. this is only a sample of the total dataset.
year company id_name permno_adj totaloutput
1996 3 D SYS INC 9 78664 1
1996 3 D SYS INC 9 78664 2
1996 3 D SYS INC 9 78664 3
1996 3 D SYS INC 9 78664 4
1996 3 D SYS INC 9 78664 5
1996 3 D SYS INC 9 78664 6
1996 3 D SYS INC 9 78664 7
1996 3 D SYS INC 9 78664 8
1996 3 D SYS INC 9 78664 9
1996 3COM CORP 11 76129 1
1996 3COM CORP 11 76129 2
1996 3COM CORP 11 76129 3
1996 3COM CORP 11 76129 4
1996 3COM CORP 11 76129 5
1996 3COM CORP 11 76129 6
1996 3COM CORP 11 76129 7
1996 3COM CORP 11 76129 8
1996 3COM CORP 11 76129 9
1996 3COM CORP 11 76129 10
1996 3COM CORP 11 76129 11
1996 3COM CORP 11 76129 12
1996 3COM CORP 11 76129 13
1996 3COM CORP 11 76129 14
1996 3COM CORP 11 76129 15
1996 3COM CORP 11 76129 16
1996 3COM CORP 11 76129 17
1996 3COM CORP 11 76129 18
1996 3COM CORP 11 76129 19
1996 3COM CORP 11 76129 20
1996 3COM CORP 11 76129 21
1996 3D LAB INC LTD 12 84266 1
1996 3D LAB INC LTD 12 84266 2
1996 3D LAB INC LTD 12 84266 3
I'd very much appreciate your help. thank you in advance!
Related Posts with How to compute sum of observations for year and company (identified by id_name)
Summarize Variables With District WeightsMy data comes with sample weights to make it representative of a school district. I know to tabulate…
Writing memory data to word tableHello As part of my job the results I get from Stata need to put into tables in a word document to…
Add significance stars to F-stat with esttabDear all, I was wondering how to add significance stars for F-stat in my tables with esttab. I trie…
ADF is WLS?Dear friends of STATA, I have version 13 of Stata and I wanted to ask you if the ADF method used by…
Replacing values in one goIn my data set, the values of a string variable are composed of more than one word. Hence there is a…
Subscribe to:
Post Comments (Atom)
0 Response to How to compute sum of observations for year and company (identified by id_name)
Post a Comment