Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Statistics help please

Author  Topic 

aiken
Aged Yak Warrior

525 Posts

Posted - 2004-06-14 : 20:16:17
No, not like "update statistics."

I need help with a popularity rating system. It's about what you'd expect: users can vote on an item, and we rank them using avg(vote).

However, I'd like to use something less subject to manipulation than a simple average. I know enough about statistics to know what a standard deviation is, but that's about it.

Can someone take pity on me and explain how I could easily do something like, for instance, throwing out the top 5% and bottom 5% of votes before taking the average? Preferably something fast and math based rather than iterative and TSQL based, if that makes sense.

I'm not married to that particular option; it just seemed like a way to throw out joke or malicious votes. If there's a more pure statistical way to do it, I'd love to hear it.

Thanks
-b

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-06-16 : 06:40:46
something like this:

select avg(votes) from table where votes between (min(votes) + 0.05*max(votes)) and (0.95*max(votes))

Go with the flow & have fun! Else fight the flow :)
Go to Top of Page

dataphile
Yak Posting Veteran

71 Posts

Posted - 2004-06-17 : 09:19:45
Can a person vote more than once for the same item?
Firstly prevent this from happening.

I guess that every person has to rate the item on a scale (say 1-5)

So for every item, calculate the average votes per interval and only
count the votes that are within one standard deviation from that average.

Or simply use the item on the scale with the most votes. "Most people gave this item a 3/5"
Go to Top of Page
   

- Advertisement -