I'm trying to find out if there is a simple way in Mathematica to deal with grouped data. For example a table showing the number of children in different families and the frequency, 3 have 0 children, 5 have 1 child, 7 have 2, 6 have 3, 3 have 4 and 1 has 5. Which I'd write as a list as such:
- Code: Select all
If I ask for the mean it just gives me two means, one for each column. I can't find anything under the help for Mean that'll let me treat it differently. Is there an existing function that can treat the second column as the frequencies? Or doI need to create functions to do this myself?