Hi all,
I have a question.
I have a dataset like the left table in my screenshot (small example). In this dataset, there are different combinations between origin and destination which each the number of employees working in each sector and the total listed.
Now I want to transform/reshape this dataset to the right table, where each origin is listed only once. For this origin, now the sum of all destinations that belong to that origin are listed.
The variables remain the same (S1, S2, S3, S4, S5, Total)
Thank you in advance!
Romy
Array
Related Posts with Taking the sum of some observations
Can xtabond2/xtdpdgmm be applied to estimate a static (rather than dynamic) panel data model?Dear All, The (ssc install) xtabond2 and (ssc install) xtdpdgmm commands are commonly used to estima…
Combine different tabstat results in oneCan I substitute count of the number of observations with the count of unique "conm" which stands fo…
merging datasetsI am trying to merge two datasets, which have the date variable in common. However, when I try to me…
Counting number of occurrence of observations based on two variablesDear community, I have a dataset; the following code generates a snippet of it Code: clear input …
Drop observations given multiple conditionsHi everyone, I am working on a state dataset where I need to keep observations of firms with non-mi…
Subscribe to:
Post Comments (Atom)
0 Response to Taking the sum of some observations
Post a Comment