BookmarkSubscribe
Choose Language Hide Translation Bar
Community Trekker

## Make size of bubbles in bubble plot proportional to count

I have a bubble plot in which each axis is a different, discrete list of mutually-exclusive text descriptors for the data (for instance, imagine a table of vehicle attributes where the X axis has different vehicle size classifications like subcompact, compact, sedan, etc. and the Y axis has cost descriptors such as bargain, relatively inexpensive, average cost, relatively expensive, and uber-expensive).  I want the size of each bubble to be proportional to the total number of times that that combination of X and Y values appears in my data table.  How do I do this?  Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

## Re: Make size of bubbles in bubble plot proportional to count

I am not sure if this is what you are looking for, but given the information you specified, and the rules for the Bubble Plot, you will need to create a new column that represents the values you want to use for the size, and then specify the new column as the "Sizes" column to the Bubble Plot.

Jim
5 REPLIES 5
Super User

## Re: Make size of bubbles in bubble plot proportional to count

I am not sure if this is what you are looking for, but given the information you specified, and the rules for the Bubble Plot, you will need to create a new column that represents the values you want to use for the size, and then specify the new column as the "Sizes" column to the Bubble Plot.

Jim
Community Trekker

## Re: Make size of bubbles in bubble plot proportional to count

Thanks - that makes sense, although I was hoping there would be a way for JMP to do it automatically.  The only minor hassle is that I haven't yet found an equivalent formula in JMP to Excel's SUMPRODUCT that would make doing those tallies easy - but I can do that in Excel and bring the data in.

Highlighted
Super User

## Re: Make size of bubbles in bubble plot proportional to count

The JMP equivalent to the SumProduct function in Excel is:

Sum(A:*B)

Where both A and B are matricies.  The issue with this, is the defining of the matricies.  Below is a script that  takes two approaches to doing the SumProduct on the sample data table "Big Class".  My assumption is that you will need to calculate the SumProduct for different rows, based upon a grouping value in another column.  The first approach uses a single column to do the SumProduct, using the above approach, calculating the SumProduct separatly for the values of the column Sex.  The second approach uses 2 columns.  The first column calculates the product, and the second column calculates the sum of those products for the column Sex.

Names Default To Here( 1 );
dt = Open( "\$SAMPLE_DATA\big class.jmp" );

// Create the SumProduct in one formula
dt << New Column( "SumProduct",
formula(
dt = Current Data Table();
gender = :sex[Row()];
TheRows = dt << get rows where( :sex == gender );
aMat = dt:height[TheRows];
bMat = dt:weight[TheRows];
Sum( aMat :* bMat );
)
);

// Create the SumProduct using 2 column formulas
dt << New Column( "Product", formula( :height * :weight ) );
dt << New Column( "ColSum", formula( Col Sum( :Product, :sex ) ) );
Jim
Community Manager

## Re: Make size of bubbles in bubble plot proportional to count

You can do this. You just need to summarize the data first.

Here's the Car Poll data from the Sample Data.

Then go to Tables->Summary and group it by Marital Status and Type.

which gets you this:

and now, use Bubble Plot with Marital Status on Y, Type on X and N Rows as Size.

On the other hand, I'm not sure that's the best visualization for this type of data. Starting with the original Car Poll data (no need to summarize) you can use Graph Builder with Marital Status on the Y and Type on the X and use the Mosaic element.

-Jeff
Community Trekker

## Re: Make size of bubbles in bubble plot proportional to count

txnelson & Jeff -

Thank you both very much - those are all methods I'll pursue.

Ripple