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)
save as .exp fileGood Morning, a client wants to have a stata dataset in SAS. Therefore I exported the data as a v8x…
Multiple Baseline DesignHello Everyone. I have been following STATALIST for a while now and really appreciative of its help.…
How to fix autocorrection in OLSHello, I have panel data ( N is large with T is small). My data has autocorrection and don't have he…
dyadic years data and overconfident resultsArray Array Hi, I have dyadic-years data. my DV is a count variable and it's overdispersed. I run…
Import delimited recognizes (wrongly?) a variable as srtLDear Statalanders, While importing the attached mdl_course.csv with -import delimited- in Stata 16,…
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