Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Daniel Marcelino <dmsilv@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: computing preference choices |

Date |
Tue, 27 Dec 2011 03:16:57 -0500 |

Dear all, I dealing with a puzzle that I need some help. I have a data set where I'd like to determine within "r" the most preferable choice (choice1 to n) as in the replication above. So, there are three essential tasks: I need to tally the votes for every id (number), I need to see if the number id with most votes has at least 50%+ of all votes, and I need to discover who's the id the the least amount of votes. After performed these tasks in fly, I need to save the winner information (r and which round choice), I need to proceed dropping id got lesser votes in the first choice, but considering its second choice vote. Test again if there is any id with 50%+ of all votes. This procedure ends when any id gets 50%+ in each "r". Daniel clear input str2 r w byte(choice1 choice2 choice3) "a" .5 1 2 3 "a" .1 2 3 4 "a" .9 3 2 5 "a" .9 3 4 2 "a" .2 4 5 1 "a" .3 5 1 3 "b" .4 1 4 3 "b" .1 2 3 4 "b" .6 3 2 5 "b" .85 4 1 2 "b" .85 4 5 1 "b" .7 1 5 4 "c" .4 2 1 3 "c" .2 2 4 1 "c" .7 3 4 5 "c" .8 4 1 2 "c" .8 4 5 1 "c" .4 5 4 3 "d" .4 . 1 3 "d" .2 2 4 . "d" .7 . 5 . "d" .8 4 1 2 "d" .8 4 5 1 "d" .4 . . . end -- About me: http://danielmarcelino.zip.net/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st: computing preference choices***From:*Nick Cox <njcoxstata@gmail.com>

- Prev by Date:
**RE: st: XTIVREG2: Are my instruments proper?** - Next by Date:
**st: Mata problem with nonreals [was: Re: Mata finds nonreal although I can't find a no nonreal]** - Previous by thread:
**st: Mata finds nonreal although I can't find a no nonreal** - Next by thread:
**Re: st: computing preference choices** - Index(es):