Super User

Joined:

Mar 17, 2015

## Fit Group and By

Is Fit Group supposed to actually force by graphs inside it to respect by columns?  It seems like the graphs are just being duplicated with a header that says Fit Group age=12, sex=M.

``````names default to here(1);
dt = open("\$SAMPLE_DATA\Big Class.jmp");
fg = dt << Fit Group(
dt << OneWay( Y( :weight, :height ), X( :name ) ),
<<{Arrange in Rows(2)},
By(:age, :Sex)
); //I like the way this looks but it doesn't seem to actually respect the By in the graphs

//this one respects the by but puts the groupings in each graph which is pretty ugly
//and doesn't arrange in rows
g1 = dt << Oneway( Y( :weight, :height ), X( :name ), By(:age, :Sex) )``````
1 ACCEPTED SOLUTION

Accepted Solutions

Staff

Joined:

Jun 25, 2014

Solution

## Re: Fit Group and By

You can include the By statement in both the call to Oneway() and Fit Group() and JMP will arrange the output accordingly. Is this what you were looking for?

``````names default to here(1);
dt = open("\$SAMPLE_DATA\Big Class.jmp");
g2 = dt << Fit Group( Oneway( Y( :weight, :height ), X( :name ), By(:age, :Sex) ), << Arrange in Rows(2), By(:age, :Sex));``````

You mentioned that you may have up to 10 By variables, which means the titles on the "Oneway Analysis" outline boxes will get pretty unruly. You could remove them altogether (which will also hide the Red Triangle menu) with the following code:

``( g2 << XPath("//OutlineBox[@helpKey='Oneway Report']") ) << {Set Title( "" )};` `

Or, you could rename them all with just a space to retain the red triangle menu but have a cleaner view:

``( g2 << XPath("//OutlineBox[@helpKey='Oneway Report']") ) << {Set Title( " " )};``

I hope this helps!

3 REPLIES

Community Trekker

Joined:

Jun 23, 2011

## Re: Fit Group and By

Are you looking for something closer to this?

``g2 = dt << Fit Group( Oneway( Y( :weight, :height ), X( :name ), By(:age, :Sex) ), << Arrange in Rows(2));``
Highlighted

Super User

Joined:

Mar 17, 2015

## Re: Fit Group and By

I've been able to do that.  The problem with that is that the description of the by is on each graph. Also it only creates one fit group.  I'd like to have 1 fit group per by with only the corresponding graphs in it.   I have somewhere north of 10 columns in the by so it gets really ugly.  My real question is, why have fit group even have a by if it doesn't really do anything.  Or I may be missing something.

Staff

Joined:

Jun 25, 2014

Solution

## Re: Fit Group and By

You can include the By statement in both the call to Oneway() and Fit Group() and JMP will arrange the output accordingly. Is this what you were looking for?

``````names default to here(1);
dt = open("\$SAMPLE_DATA\Big Class.jmp");
g2 = dt << Fit Group( Oneway( Y( :weight, :height ), X( :name ), By(:age, :Sex) ), << Arrange in Rows(2), By(:age, :Sex));``````

You mentioned that you may have up to 10 By variables, which means the titles on the "Oneway Analysis" outline boxes will get pretty unruly. You could remove them altogether (which will also hide the Red Triangle menu) with the following code:

``( g2 << XPath("//OutlineBox[@helpKey='Oneway Report']") ) << {Set Title( "" )};` `

Or, you could rename them all with just a space to retain the red triangle menu but have a cleaner view:

``( g2 << XPath("//OutlineBox[@helpKey='Oneway Report']") ) << {Set Title( " " )};``

I hope this helps!