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)
Estimate risk for groupsCiao Here is the example using Stata data. Code: use http://www.stata-press.com/data/r13/drugtr …
Help with creating a variable with lagged valuesHey guys, I am currently a final year student and i am writing my Economics dissertation on Oil pri…
Replacing values by group year in panel dataDear Stata users, I am working with a panel data set. I'm trying to see how government policies aff…
How compare categories from a one variable they are the same among 10 data sets.Hello everybody, I’m working whit 10 data sets from the household survey, and I want to know if in a…
Unit-root and Johansen- lack of normal distribution. Please help!I have a question concerning unit-root data and normal distribution. As an assignment, I am checking…
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