Subscribe Bookmark RSS Feed

V Box List and H Box List Chart Layout

rbeckman

Community Trekker

Joined:

Jan 2, 2012

Hi.  I am a new user to JSL and this forum.  I use JMP9.

I would like to create graphs that are shown horizontally by chart type, and vertically by group.  This is the default display for JMP, but I am having trouble generating a script to do this for an unspecified number of groups.

Below is a simple script to generate the charts I would like.  How can I write a script to do this for an unspecified number of groups ("age" in this case)?  Is there a more clever way to do this?

Thanks.

<!--
dt = Open( "$SAMPLE_DATA/Big Class.JMP" );

New Window( "Big Class - Oneway",
V List Box(
  H List Box(
   Bivariate( Y( :height ), X( :weight ), Where( :age == 12 ) ),
   Oneway(
    Y( :height ),
    X( :sex ),
    All Graphs( 0 ),
    Means and Std Dev( 1 ),
    Plot Quantile by Actual( 1 ),
    Line of Fit( 0 ),
    Box Plots( 1 ),
    Mean Lines( 1 ),
    Mean CI Lines( 1 ),
    Mean Diamonds( 1 ),
    Mean Error Bars( 1 ),
    Std Dev Lines( 1 ),
    X Axis Proportional( 0 ),
    Points Jittered( 1 ),
    Points Spread( 1 ),
    Grand Mean( 0 ),
    Where( :age == 12 )
   )
  ),
  H List Box(
   Bivariate( Y( :height ), X( :weight ), Where( :age == 13 ) ),
   Oneway(
    Y( :height ),
    X( :sex ),
    All Graphs( 0 ),
    Means and Std Dev( 1 ),
    Plot Quantile by Actual( 1 ),
    Line of Fit( 0 ),
    Box Plots( 1 ),
    Mean Lines( 1 ),
    Mean CI Lines( 1 ),
    Mean Diamonds( 1 ),
    Mean Error Bars( 1 ),
    Std Dev Lines( 1 ),
    X Axis Proportional( 0 ),
    Points Jittered( 1 ),
    Points Spread( 1 ),
    Grand Mean( 0 ),
    Where( :age == 13 )
   )
  ),
  H List Box(
   Bivariate( Y( :height ), X( :weight ), Where( :age == 14 ) ),
   Oneway(
    Y( :height ),
    X( :sex ),
    All Graphs( 0 ),
    Means and Std Dev( 1 ),
    Plot Quantile by Actual( 1 ),
    Line of Fit( 0 ),
    Box Plots( 1 ),
    Mean Lines( 1 ),
    Mean CI Lines( 1 ),
    Mean Diamonds( 1 ),
    Mean Error Bars( 1 ),
    Std Dev Lines( 1 ),
    X Axis Proportional( 0 ),
    Points Jittered( 1 ),
    Points Spread( 1 ),
    Grand Mean( 0 ),
    Where( :age == 14 )
   )
  ),
  H List Box(
   Bivariate( Y( :height ), X( :weight ), Where( :age == 15 ) ),
   Oneway(
    Y( :height ),
    X( :sex ),
    All Graphs( 0 ),
    Means and Std Dev( 1 ),
    Plot Quantile by Actual( 1 ),
    Line of Fit( 0 ),
    Box Plots( 1 ),
    Mean Lines( 1 ),
    Mean CI Lines( 1 ),
    Mean Diamonds( 1 ),
    Mean Error Bars( 1 ),
    Std Dev Lines( 1 ),
    X Axis Proportional( 0 ),
    Points Jittered( 1 ),
    Points Spread( 1 ),
    Grand Mean( 0 ),
    Where( :age == 15 )
   )
  ),
  H List Box(
   Bivariate( Y( :height ), X( :weight ), Where( :age == 16 ) ),
   Oneway(
    Y( :height ),
    X( :sex ),
    All Graphs( 0 ),
    Means and Std Dev( 1 ),
    Plot Quantile by Actual( 1 ),
    Line of Fit( 0 ),
    Box Plots( 1 ),
    Mean Lines( 1 ),
    Mean CI Lines( 1 ),
    Mean Diamonds( 1 ),
    Mean Error Bars( 1 ),
    Std Dev Lines( 1 ),
    X Axis Proportional( 0 ),
    Points Jittered( 1 ),
    Points Spread( 1 ),
    Grand Mean( 0 ),
    Where( :age == 16 )
   )
  ),
  H List Box(
   Bivariate( Y( :height ), X( :weight ), Where( :age == 17 ) ),
   Oneway(
    Y( :height ),
    X( :sex ),
    All Graphs( 0 ),
    Means and Std Dev( 1 ),
    Plot Quantile by Actual( 1 ),
    Line of Fit( 0 ),
    Box Plots( 1 ),
    Mean Lines( 1 ),
    Mean CI Lines( 1 ),
    Mean Diamonds( 1 ),
    Mean Error Bars( 1 ),
    Std Dev Lines( 1 ),
    X Axis Proportional( 0 ),
    Points Jittered( 1 ),
    Points Spread( 1 ),
    Grand Mean( 0 ),
    Where( :age == 17 )
   )
  )
)
);
-->

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

One approach is to use a for-loop to populate the window by re-using expressions for the graphs appending them, in this case, in pairs. See the example script below.

dt = Open( "$SAMPLE_DATA/Big Class.JMP" );

// list of unique values

g = Associative Array( :age << get values ) << get keys;

// Graph Expressions

bivexpr = Expr(

          Bivariate( Y( :height ), X( :weight ), Where( :age == Expr( g[i] ) ) )

);

owexpr = Expr(

          Oneway(

                    Y( :height ),

                    X( :sex ),

                    All Graphs( 0 ),

                    Means and Std Dev( 1 ),

                    Plot Quantile by Actual( 1 ),

                    Line of Fit( 0 ),

                    Box Plots( 1 ),

                    Mean Lines( 1 ),

                    Mean CI Lines( 1 ),

                    Mean Diamonds( 1 ),

                    Mean Error Bars( 1 ),

                    Std Dev Lines( 1 ),

                    X Axis Proportional( 0 ),

                    Points Jittered( 1 ),

                    Points Spread( 1 ),

                    Grand Mean( 0 ),

                    Where( :age == Expr( g[i] ) )

          )

);

 

// Make new window

New Window( "Big Class - Oneway", vlb = V List Box() );

// Populate window iteratively

For( i = 1, i <= N Items( g ), i++,

          vlb << append(

  H List Box(

                              Eval( Eval Expr( bivexpr ) ),

                              Eval( Eval Expr( owexpr ) )

                    )

          )

);

2 REPLIES
Solution

One approach is to use a for-loop to populate the window by re-using expressions for the graphs appending them, in this case, in pairs. See the example script below.

dt = Open( "$SAMPLE_DATA/Big Class.JMP" );

// list of unique values

g = Associative Array( :age << get values ) << get keys;

// Graph Expressions

bivexpr = Expr(

          Bivariate( Y( :height ), X( :weight ), Where( :age == Expr( g[i] ) ) )

);

owexpr = Expr(

          Oneway(

                    Y( :height ),

                    X( :sex ),

                    All Graphs( 0 ),

                    Means and Std Dev( 1 ),

                    Plot Quantile by Actual( 1 ),

                    Line of Fit( 0 ),

                    Box Plots( 1 ),

                    Mean Lines( 1 ),

                    Mean CI Lines( 1 ),

                    Mean Diamonds( 1 ),

                    Mean Error Bars( 1 ),

                    Std Dev Lines( 1 ),

                    X Axis Proportional( 0 ),

                    Points Jittered( 1 ),

                    Points Spread( 1 ),

                    Grand Mean( 0 ),

                    Where( :age == Expr( g[i] ) )

          )

);

 

// Make new window

New Window( "Big Class - Oneway", vlb = V List Box() );

// Populate window iteratively

For( i = 1, i <= N Items( g ), i++,

          vlb << append(

  H List Box(

                              Eval( Eval Expr( bivexpr ) ),

                              Eval( Eval Expr( owexpr ) )

                    )

          )

);

rbeckman

Community Trekker

Joined:

Jan 2, 2012

Works great.  Thanks!