search for: market_con

Displaying 1 result from an estimated 1 matches for "market_con".

2010 Aug 11
1
How to calculate the concentration
...uit','fruit','fruit','drink','drink','drink') type=c('apple','apple','orange','water','soda','soda') value=c(2,3,1,5,7,6) data=data.frame(food,type,value) share=c((2+3)/(2+3+1),5/6,1/6,5/(5+7+6),13/18,13/18) market_con=c(rep(0.8333333^2+0.1666667^2,3),rep(0.2777778^2+0.7222222^2,3)) data$market_con=market_con ###### My problem is how to calculate the concentration (market_con) for different 'food' (1st column). For one food, the concentration is defined as the sum of the squares of share of each type. Th...