Choose Language Hide Translation Bar
Highlighted
ranjan_mitre_or
Level III

How to get the table of values after constructing a histogram?

After I generate a histogram of the entries in a column, I would like to get out a table of the values of the individual bars that I can list on each bar. How can I do that?

5 REPLIES 5
Highlighted
Thierry_S
Level VI

Re: How to get the table of values after constructing a histogram?

Hi,

Since nobody came up with an elegant solution, here is my rather ugly solution

 

  1. Create your distribution graph: Distribution > xyz
  2. In the analysis menu, choose Save > Level Midpoints (new column created at the end of your table)
  3. Select Tabulate > Midpoint xyz --> Drop zone for rows
  4. In the analysis menu, choose "Make into table" --> New table with column #1 = Midpoint values and column #2 count of items
  5. To check that you have the right result, go to Graph Builder > X = Midpoint values and Y = count > Bar graph

Let me know if you need the probability data (it's a bit more complicated)

 

Best regards,

 

TS

Thierry R. Sornasse
Highlighted
dale_lehman
Level VI

Re: How to get the table of values after constructing a histogram?

Highlight the bar you are interested in.  Rightclick and choose Subset - but make sure you have the column in the dataset you are interested in (the one you show the distribution of).  You will have a new dataset of the values in that bar.

Highlighted
ranjan_mitre_or
Level III

Re: How to get the table of values after constructing a histogram?

That's not what I need. I would like to calculate the Probability Mass Function corresponding to the histogram. So, I need to get out the number of values that are in each bin, that I will divide by the total number of bins to get the PMF.

Highlighted
ranjan_mitre_or
Level III

Re: How to get the table of values after constructing a histogram?

So, what I need is an easy way to get out the table of counts. It's possible to do it manually, by listing the counts on each bar, but looking for an easier way, especially if I have a large number of bars in the histogram.

Thanks
Highlighted

Re: How to get the table of values after constructing a histogram?

Separately from the histogram you could use the If() function in a column formula to assign a bin, then use Tables > Summary or Analyze > Tabulate to obtain the counts for each bin. Have you seen the ColsUtilities > Make Binning Formula command?

 

Capture.PNG

 

All of this action could be scripted.

Learn it once, use it forever!
Article Labels

    There are no labels assigned to this post.