0
|
9636 Views
|
3 Replies
|
3 Total Likes
View groups...
Share
GROUPS:

# How do I make a histogram using data from a frequency distribution table?

Posted 9 years ago
 In my maths textbook I already have the frequency distribution table, and I want to create a histogram using that data. And when I'm inputting the data into my histogram, rather than listing each number the amount of times it occurs (e.g.{48,48,49,49,49,49,49,49,49,49,49,49,...,53,53}), is it possible to input something that the histogram would recognise as the frequency of a number (e.g. "50 occurs 32 times", rather than typing 50, 32 times). 3 Replies
Sort By:
Posted 9 years ago
 The average is just taking each data item times its frequency and adding them all together and then dividing by the total of all the frequencies. So.... In:= dataSpec = {{1, 12}, {3, 4}, {9, 34}, {32, 7}}; In:= data = dataSpec[[All, 1]] Out= {1, 3, 9, 32} In:= frequencies = dataSpec[[All, 2]] Out= {12, 4, 34, 7} In:= Tr[data frequencies]/Tr[frequencies] Out= 554/57 
Posted 9 years ago
 How would I then work out the average using the number set I have just gotten, without having to go in and manually delete all the " { } "
Posted 9 years ago
 Well one hack would be to generate the needed data for the histogram from your specification. So, let's say your spec what you suggested, e.g. {value,nValues}. Then you could recreate the data from this by using ConstantArray on it. Here's an example: dataSpec = {{1, 12}, {3, 4}, {9, 34}, {32, 7}}; histogramData = ConstantArray[#[], #[]] & /@ dataSpec Histogram[histogramData, 40]