Hey everyone,
I have a very easy question, but I am just not solving it. Let's suppose I have two departement with a given variable x. My dataset looks like:
Departement x
1 5
1 7
1 7
2 2
2 2
2 2
Now, I want to create a variable which sums all DISTINCT values of x by departement. So my dataset should look like:
Departement x y
1 5 12
1 7 12
1 7 12
2 2 2
2 2 2
2 2 2
How do I do that?
Best,
Simeon
Related Posts with Sum distanct values of a variable by group
Statistically significant coefficient of zero in Poisson panel regressionHello Statalist members, i am analysing a firm panel where I am regressing the number of high skill…
Interpreting Dummy variable and constantHi everyone, I want to study the effect of private universities systems with high tuition fees on i…
Replicating Spatial Regression (with Spatially correllated disturbances) on MataHey guys, So I am trying to solve the following model in Mata: y = x + u u = rho*u + e This regr…
I suppose something wronf with my codeI am running multiple regression with one categorical independent and six other variables. The datas…
using egen's max function with a localHello! I am Nithya. This is my first post, and i've tried to follow the advice on posting. But plea…
Subscribe to:
Post Comments (Atom)
0 Response to Sum distanct values of a variable by group
Post a Comment