So I have the results from a survey, but they're aggregated by year and response number. I for the devil of me cannot figure out how to get average survey response by the scale. Like for instance, for 2010, I have:
\begin{array}{|c|cccccc|}\hline\text{Value}&0 & 1 & 2 & 3 & 4 & 5\\\hline \text{Frequency}&1 & 0 & 4 & 21 & 37 & 17\\\hline\end{array}
And the average of the bottom row is $13.33$, but that doesn't tell me what I want. That tells me the average number of responses, but I want the average response on the scale. I have no idea aside from making a dataset with 17 5s etc and then doing an average on that?
Consider a basic example first: \begin{array}{|c|ccc|}\hline\text{Value}&1&2&3\\ \hline \text{Frequency}&2&3&5\\\hline\end{array}
This is equal to the following dataset: $1,1,2,2,2,3,3,3,3,3$
We would calculate the average value by computing
\begin{align}\frac{\text{sum of items}}{\text{number of items}}&=\frac{1+1+2+2+2+3+3+3+3+3}{10}\\ &=\frac{23}{10}\\ &= 2.3\end{align}
This is equal to $$\frac{1\times 2+2\times 3+3\times 5}{2+3+5}=\frac{2+6+15}{10}=\frac{23}{10}=2.3$$
i.e we multiply each value by its frequency, add them together, and then divide by the sum of the frequencies
Therefore, we would compute \begin{align}\frac{0\times 1+1\times0+2\times 4+3\times 21+4\times 37+5\times 17}{1+0+4+21+37+17} &= \frac{0+0+8+63+148+85}{80}\\ &= \frac{304}{80}\\ &=3.8\end{align}