Hello!
I am currently working on a panel dataset containing, amongst others, the variables "companies", "year" (2010-2018), "sector" (arbitrary 4 digit number), and "net sales". Now,
I want to generate a new variable, namely, the sum of the net sales for all individual companies in each corresponding sector and the corresponding year.
I tried to find a command, however, I was unsuccessful.
Can anyone help me out?
Thank you in advance!
Related Posts with Creating a sum variable which depends on 2 other variables
Bar graph with confidence intervals and character group labelsSo this bothers me for a while. I want to have a bar graph for group means with confidence intervals…
Why the logical in Stata of calculating missing observation is quite strangeToday I calculate Code: gen year1a=1 if yr <=ei +1 While ei=. and yr=1990, I saw the result of …
How to bound x-axis on histogramI'm using the command histogram [cat var] to output a histogram in stata. I only care about the va…
how do do a rolling WLS in stataI would like to run a rolling regression in Stata, where in each window the weights of independent v…
Separating string variable with parenthesis and commasHello, I have variable that looks like Experience ('Santo Engineering', '2017-04-30', '2017-05-30'…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a sum variable which depends on 2 other variables
Post a Comment