I’m trying to characterize how prominent a selection is. You poll 10 people for their favorite color and you get the following response:
r = c(rep("blue",5),rep("green",4),rep("red",1))
And you make a contingency table:
tab = table(r)
If you take the density of this...
d = density(tab)
If you ask someone else and they say "red", you characterize the prominence of this response by the integral of the portion of the probability density function equal to or less than the rate of their response:
get.prominence = function(new.response){
rate = tab[new.response]
window.index = tail(which(d$x<=rate),n=1)
sum(d$y[1:window.index])/sum(d$y)
}
get.prominence("red") # .16
get.prominence("blue") # .77
Is this a reasonable way of doing this? There must be a known technique for this and I don't know the name of it.
