d0=Open("$SAMPLE_DATA/Big Class.jmp");
d0 << Select Where( age < 16 );
dt = d0 << Subset(
Output Table( "test" ),
Selected Rows( 1 ),
selected columns( 0 )
);
Try( dt << Delete Table Property( "Source" ) );
d2 = dt << Summary(
Group( age ),
Freq( 0 ),
Weight( 0 ),
Link to original data table( 0 ),
Output Table( "tem" )
);
Column( d2, 2 ) << set name( "row" );
mi = Min( d2[0, "row"] );
ca = "ratio";
New Column( ca );
Column( ca ) << Formula( Round( row / mi, 2 ) );
d2 << run formulas;
Column( ca ) << deleteFormula;
dt << Update( With( d2 ), Match Columns( age = age ) );
Close( d2, nosave );
Current Data Table( dt );
ca = "list";
New Column( ca );
Column( ca ) << Formula(
If( Row() == 1 | age != Lag( age, 1 ),
r = Row();
1;
,
Floor( (Row() - r) / ratio + 1 )
)
);
d0 << run formulas;
Column( ca ) << deleteFormula;
p1 = dt << Graph Builder(
Size( 690, 466 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Show X Axis( 0 ),
Show Y Axis( 0 ),
Variables(
X( :weight ),
Y( :height ),
Group X( :age, Show Title( 0 ) ),
Color( :sex )
),
Elements(
Bar(
X,
Y,
Legend( 5 ),
Response Axis( "X" ),
Summary Statistic( "Sum" )
)
),
SendToReport(
Dispatch(
{},
"graph title",
TextEditBox,
{Hide( 1 )}
),
Dispatch( {}, "X title", TextEditBox, {Hide( 1 )} ),
Dispatch( {}, "Y title", TextEditBox, {Hide( 1 )} )
)
);
p2 = dt << Graph Builder(
Size( 686, 404 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Show X Axis( 0 ),
Show Y Axis( 0 ),
X Group Edge( "Bottom" ),
Variables(
X( :list ),
Y( :height ),
Group X( :age, Show Title( 0 ) )
),
Elements(
Bar( X, Y, Legend( 5 ), Summary Statistic( "Sum" ) )
),
SendToReport(
Dispatch(
{},
"graph title",
TextEditBox,
{Hide( 1 )}
),
Dispatch( {}, "X title", TextEditBox, {Hide( 1 )} ),
Dispatch( {}, "Y title", TextEditBox, {Hide( 1 )} )
)
);