Names Default to Here (1); dt = current datatable (); CoList = dt << get column names (string); try( close( dt1, nosave ) ); ((dt << Tabulate(invisible, Add Table( Column Table( Grouping Columns( :VISIT ) ), Row Table( Grouping Columns( :SHORT TAG ) ) ) )) << Make Into Data Table) << Set Name ("TEMP"); dt1 = data table ("TEMP"); CCount = column (dt1, "BL"); Current Data Table (dt); LMin = -1.5; LMax = 0.5; For (i= 5, i<=7, i++, summarize ( grp = By(:SHORT TAG, Column("DURATION (Week)") ), xb = Mean(Column(dt,i) ) , sd= Std Dev( Column(i) ), nc = Count(Column(i)) ); //LMin = Minimum(xb) - 1; LMin = Round(Minimum(xb - (sd :/ sqrt(nc)) ),2) - .5 ; //alternate //LMax = Maximum(xb) + 1; LMax = Round(Maximum(xb + (sd :/ sqrt(nc)) ),2) + .5 ; //alternate POS_Y = LMin + 0.25; show (LMin, Lmax, POS_Y); gb = Eval Expr (Graph Builder( Size( 1061, 524 ), Lock Scales( 1 ), Variables( X( :Name( "DURATION (Week)" ) ), Y( column(dt,Expr(i) ) ), Group X( :LEAD TAG ), Overlay( :SHORT TAG ) ), Elements( Line( X, Y, Legend( 4 ), Smoothness( 0.5 ) ), Points( X, Y, Legend( 5 ), Summary Statistic( "Mean" ), Error Bars( "Standard Error" ), Jitter( "None" ), Jitter Limit( 0 ) ) ), SendToReport( Dispatch( {}, "DURATION (Week)", ScaleBox, {Format( "Fixed Dec", 12, 0 ), Min( -1 ), Max( 27 ), Inc( 2 ), Minor Ticks( 1 ), Add Ref Line( 14, "Solid", "Black", "", 2 )} ), Dispatch( {}, _TXT_, ScaleBox, {Format( "Fixed Dec", 12, 1 ), Min( LMin ), Max( LMax ), Inc( 0.5 ), Minor Ticks( 1 ), Add Ref Line( 0, "Dotted", "Black", "", 2 ), Label Row( {Set Font Size( 12 ), Set Font Style( "Plain" )} )} ), Dispatch( {}, "", ScaleBox, {Format( "Fixed Dec", 12, 2 ), Min( -0.5 ), Max( 0.5 ), Inc( 0.25 ), Minor Ticks( 0 )} ), Dispatch( {}, "X title", TextEditBox, {Set Font Size( 12 ), Set Font Style( "Bold" )} ), Dispatch( {}, "Y title", TextEditBox, {Set Font Size( 12 ), Set Font Style( "Bold" )} ), Dispatch( {}, "Graph Builder", FrameBox, {Marker Size( 6 ), Left( 1 ), Right( 1 ), Top( 0 ), Bottom( 1 ), Add Graphics Script( 2, Description( "Script" ), Text Size (10); Text Color ("Dark Red"); Text( Center Justified, {21, Expr(POS_Y)}, N1 ); Text Color ("Light Red"); Text( Center Justified, {21, Expr(POS_Y)-0.1}, N2); ), Grid Line Order( 1 ), Reference Line Order( 3 )} ), Dispatch( {}, "Graph Builder", FrameBox( 2 ), {Marker Size( 6 ), Left( 0 ), Right( 1 ), Top( 0 ), Bottom( 1 ), Add Graphics Script( 2, Description( "Script" ), Text Size (10); Text Color ("Dark Green"); Text( Center Justified, {21, Expr(POS_Y)}, N3 ); Text Color ("Light Green"); Text( Center Justified, {21, Expr(POS_Y)-0.1}, N4 ); ), Grid Line Order( 1 ), Reference Line Order( 3 )} ), Dispatch( {}, "Graph Builder", FrameBox( 3 ), {Marker Size( 6 ), Add Graphics Script( 2, Description( "Script" ), Text Size (10); Text Color ("Dark Blue"); Text( Center Justified, {21, Expr(POS_Y)}, N5 ); Text Color ("Light Blue"); Text( Center Justified, {21, Expr(POS_Y)-0.1}, N6 ); ), Grid Line Order( 1 ), Reference Line Order( 3 )} ) ) ) ); xp = Substitute (Name Expr (gb), Expr (_TXT_), CoList [i], Expr (N1), "UPA > UPA (n=" || char(CCount [1]) || ")", Expr (N2), "UPA > ADA (n=" || char(CCount [2]) || ")", Expr (N3), "ADA > ADA (n=" || char(CCount [3]) || ")", Expr (N4), "ADA > UPA (n=" || char(CCount [4]) || ")", Expr (N5), "PBO > PBO (n=" || char(CCount [5]) || ")", Expr (N6), "PBO > UPA (n=" || char(CCount [6]) || ")" ); //show( xp ); gbe = Eval (xp); gbe << journal; gbe << close window; ); Close (dt1, NoSave);