Hi, can someone please help?
I want to add a new column called ss, it should be constant across all rows within the same group_exp. As you can see, observations with the same group_exp and product have the same value of exp_shareUS_k. I want this new column to have the sum of .20564187 and .7964094. that is, the sum of this unique value of exp_shareUS_k across subgroups.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float group_exp str6 product str4 j float exp_shareUS_k 8 "852432" "ECU" .7964094 8 "852432" "PER" .7964094 8 "852432" "URY" .7964094 8 "852432" "USA" .7964094 8 "852439" "MEX" .20564187 8 "852439" "COL" .20564187 8 "852439" "USA" .20564187 end
Comment