Ciao comunità JMP,
Ho scritto un semplice (e un po' goffo) script che assembla più grafici GB in una finestra utilizzando un LineUpBox in cui aggiungo il FrameBox da ogni trama: funziona perfettamente correndo su 182 biomarcatori e assemblando i grafici per i quali sono soddisfatte determinate condizioni; (vedi sotto). Da notare che non posso condividere facilmente la tabella dei dati associata a questo script a causa della natura riservata dei dati.
Names Default to Here (1);
dt = Current Data Table ();
CLX = dt << get column names (string);
CList = {};
For (i= 1, i <= N Items (CLX), i++, insert into (CList, substitute (CLX[i], "LSMEAN ", "")));
gbe = Expr (dt << Graph Builder(
Size( 360, 360 ),
Fit to Window( "Off" ),
Level Frame Color( "Medium Dark Gray" ),
Level Spacing Color( "Medium Dark Gray" ),
Level Underline( 1 ),
Page Level Underline( 0 ),
Spacing Borders( 1 ),
Variables(
X( :Name( "DURATION (Week)" ) ),
Y( _YS_ ),
Overlay( :ARM ),
Interval( _STE_ )
),
Elements(
Points( X, Y, Legend( 5 ) ),
Line( X, Y, Interval( 0 ), Legend( 6 ) )
),
SendToReport(
Dispatch(
{},
"DURATION (Week)",
ScaleBox,
{Min( -1.5 ), Max( 10 ), Inc( 2 ), Minor Ticks( 1 )}
),
Dispatch(
{},
"Graph Builder",
FrameBox,
{Marker Size( 6 ), Add Graphics Script(
2,
Description( "Script" ),
Text Color (Black);
Pen Color (black);
Pen size (2);
Line style ("Dotted");
H Line (0);
Text Size (14);
Text( Center Justified, {4, _BPY_}, _LNAME_);
Text size (12);
Text Color( blue );
Text( Center Justified, {2, _TPY1_}, _P1_);
Text( Center Justified, {8, _TPY1_}, _P2_);
Text Color( Green );
Text( Center Justified, {2, _TPY2_}, _P3_);
Text( Center Justified, {8, _TPY2_}, _P4_);
Text Color( purple );
Text( Center Justified, {2, _TPY3_}, _P5_);
Text( Center Justified, {8, _TPY3_}, _P6_);
), Grid Line Order( 5 ), Reference Line Order( 6 )}
)
)
)
);
mylbox = Lineup Box (N Col (8));
For (i = 4, i <= 185, i++, //185
YCOL = Column (i);
STDE = Column (i+182);
LABEL = CList [i];
P1 = Column (dt, i+364) [2];
P2 = Column (dt, i+364) [3];
P3 = Column (dt, i+364) [5];
P4 = Column (dt, i+364) [6];
P5 = Column (dt, i+364) [8];
P6 = Column (dt, i+364) [9];
PPBO1 = Column (dt, i+546) [5];
PPBO2 = Column (dt, i+546) [6];
PPBO3 = Column (dt, i+546) [8];
PPBO4 = Column (dt, i+546) [9];
PVAL1 = CHAR (format(P1, "PValue"));
PVAL2 = CHAR (format(P2, "PValue"));
PVAL3 = CHAR (format(P3, "PValue"));
PVAL4 = CHAR (format(P4, "PValue"));
PVAL5 = CHAR (format(P5, "PValue"));
PVAL6 = CHAR (format(P6, "PValue"));
gbx = substitute (Name Expr (gbe), Expr (_YS_), YCOL,
Expr (_STE_), STDE,
Expr (_TPY1_), 1,
Expr (_TPY2_), 1,
Expr (_TPY3_), 1,
Expr (_BPY_), -1,
Expr (_LNAME_), LABEL,
Expr (_P1_), PVAL1,
Expr (_P2_), PVAL2,
Expr (_P3_), PVAL3,
Expr (_P4_), PVAL4,
Expr (_P5_), PVAL5,
Expr (_P6_), PVAL6
);
gb = Eval (gbx);
gbr = gb << report;
YAxis = gbr [Axis Box (2)];
YMax = YAxis << Get Max;
YMin = YAxis << Get Min;
gbr << close window;
YRange = ABS (YMax - YMin);
While (YRange <= 1.0,
YMax = YMax + (YRange * 0.1);
YMin = YMin - (YRange * 0.1);
YRange = abs (YMax - YMin);
);
YMax = YMax + (YRange * 0.15);
TOPY1 = YMax - (YRange * 0.1);
TOPY2 = YMax - (YRange * 0.18);
TOPY3 = YMax - (YRange * 0.26);
BOTY = YMin + (YRange *0.1);
gbx = substitute (Name Expr (gbe), Expr (_YS_), YCOL,
Expr (_STE_), STDE,
Expr (_TPY1_), TOPY1,
Expr (_TPY2_), TOPY2,
Expr (_TPY3_), TOPY3,
Expr (_BPY_), BOTY,
Expr (_LNAME_), LABEL,
Expr (_P1_), PVAL1,
Expr (_P2_), PVAL2,
Expr (_P3_), PVAL3,
Expr (_P4_), PVAL4,
Expr (_P5_), PVAL5,
Expr (_P6_), PVAL6
);
gb = Eval (gbx);
gbr = gb << report;
YAxis = gbr [Axis Box (2)];
YAxis << Max (YMax);
YAxis << Min (YMin);
YAxis << Inc (round (YRange/9, 1));
gbr << Set Title (LABEL);
gbr [TextEditBox (1)] << Set text (LABEL);
gbr [LegendBox (1)] << delete;
fb = gbr [FrameBox (1)];
if( Minimum (P1, P2, P3, P4, P5, P6)<= 0.01 &
Maximum ( abs (YCOL[2]), abs (YCOL[3]), abs (YCOL[5]), abs (YCOL[6]), abs (YCOL[8]), abs (YCOL[9]))>=0.2 &
Minimum (PPBO1, PPBO2, PPBO3, PPBO4) <= 0.01,
mylbox << append (fb),.);
gbr << close window;
);
New Window ("OUTPUT", mylbox);
Ora, invece di scrivere i valori P / FDR sui grafici (vedere PVAL inseriti come elementi di testo nello script grafico), vorrei aggiungere una tabella riassuntiva con questi valori P / FDR sotto ogni trama. Ho esaminato il comando "Aggiungi tabella" ma non sono sicuro che fornisca la flessibilità di formattazione di cui ho bisogno e, pertanto, vorrei sapere se esiste un modo alternativo per disegnare tabelle con maggiore flessibilità.
Qualsiasi idea, suggerimento o raccomandazione sarebbe molto apprezzata.
Grazie,
ST