I am dealing with data with information of different candidates, the results of each candidate is distributed by class 1, 2, 3, 4
Candidate A Name | Sex | Votes |Candidate B Name | Sex | Votes | Candidate C Name | Sex | Votes | Candidate D Name | Sex | Votes
Class 1
Class 2
Class 3
Class 4
Firstly, I wish to group the columns of the information of a candidate, such that
Group A [ contains Candidate A Name | Sex | Votes of Candidate A]
Group B [ contains Candidate B Name | Sex | Votes of Candidate B]
Group C [ contains Candidate B Name | Sex | Votes of Candidate C]
After that, I wish to compare the number of votes of each candidate, and to Generate the name of the candidate only with the Highest Result into a new column
For example, if Candidate D obtains highest number of vote, name fo Candaidate D will be generate in a new column
Thank you in advance
Related Posts with How to group several columns?
Regression output does not show all coefficientsHi, I have a quick question: When I enter the following code for a regression with 1 independent v…
Difference in difference with a single groupI may be misunderstanding something and need some help So I am looking at inheritances and want to …
how to do propensity score matchinghi everyone I m trying to do psm test but i do not what the wrong is this command correct or not? …
Time taken by estimation?Hi everyone, I want to calculate the time gained by a maximum likelihood estimator in coming up wit…
classified after XT models - invalid subcommand classificationHello, I am using 4 binomial models. Logit, xtlogit re, xtlogit pa, and xtlogit fe. After logit I us…
Subscribe to:
Post Comments (Atom)
0 Response to How to group several columns?
Post a Comment