# variance of a categorical variable [duplicate]

I have a categorical variable with three levels

Cu
Cu000
Cu000
Cu035
Cu175
Cu000
Cu175
Cu035
.
.
.


The exact distribution of the three values (Cu000, Cu035, Cu175) is as shown below.

Cu000 Cu035 Cu175
251   275   263


I know that if the variable is binary then variance is p*(1-p), not sure how do I estimate the variance within a 3 level categorical variable? Any suggestion is apricated thanks.

• What do you want the variance of? There are three categories here, any one of which is (obviously) binary. Thus, you must be looking for something other than the three separate variances, but what exactly would that be?
– whuber
Aug 20 at 21:54
• @whuber, I am sorry the question was not clear. I have updated my question now. Hope this is a bit clear. I am looking for variance within a categorical variable with 3 levels. Aug 21 at 0:05
• The variance of what quantity? The phrase "within a categorical variable with 3 levels" gives conditions but not what to calculate. Are you looking for the variances of each proportion for example? Aug 21 at 1:55
• In the sense that the asker is asking, there isn't one. As I understand, the asker is looking for a single number to capture how much the categorical variable deviates from having all probability mass on a single outcome. (doesn't exist—maybe entropy or some qualitative variation measure will suffice, but I don't know the asker's purpose) But you CAN look at each individual outcome (there are 3) as a Bernoulli r.v. to compute its variance. Aug 21 at 3:29
• I second the idea by @AryaMcCarthy about entropy.
– Dave
Aug 21 at 3:58