Come posso cambiare la linea di riferimento? nessun numericoCIAO Voglio inserire la media Std dei due dati nella linea di riferimento come mostrato nel grafico sottostante.
Lo script JMP di seguito ha arbitrariamente scritto la media Std, 13.2 (22.2+4.2)/2 = 13.2
In realtà i dati che utilizzo sono più di due. (L'immagine sotto è solo un esempio)
Come posso modificare lo script?
dt = Open( "$SAMPLE_DATA/Big Class.jmp" ) ;
Graph Builder(
Size( 1056, 825 ),
Variables( Y( :height ), Y( :weight ) ),
Elements(
Position( 1, 1 ),
Points( Y, Legend( 7 ) ),
Caption Box( Y, Legend( 13 ), Summary Statistic( "Std Dev" ) )
),
Elements(
Position( 1, 2 ),
Points( Y, Legend( 8 ) ),
Caption Box( Y, Legend( 14 ), Summary Statistic( "Std Dev" ) )
),
SendToReport(
Dispatch(
{},
"height",
ScaleBox,
{Add Ref Line( 13.3, "Solid", "Medium Dark Red", "Std Dev mean", 2 )}
),
Dispatch(
{},
"weight",
ScaleBox,
{Add Ref Line( 13.3, "Solid", "Medium Dark Red", "Std Dev mean", 2 )}
)
)
);
Re: Come posso cambiare linea di riferimento? nessun numericoEcco il metodo che utilizzo per acquisire le statistiche della colonna per un determinato sottogruppo, ad esempio Età, e che stai utilizzando.

Ecco la sceneggiatura.Basta aggiungere le linee di riferimento aggiuntive che desideri utilizzando la stessa metodologia
names default to here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" ) ;
gb = Graph Builder(
Size( 1056, 825 ),
Variables( X( :height ), Group Y( :age ) ),
Elements(
Bar( X, Legend( 17 ) ),
Caption Box( X, Legend( 15 ), Response Axis( "X" ) ),
Caption Box(
X,
Legend( 16 ),
Response Axis( "X" ),
Summary Statistic( "Std Dev" )
)
)
);
Report( gb )[AxisBox( 1 )] << Add Ref Line(
Col Mean( if(:age == 12,:height,.) ) + 4*Col Std Dev( If(:age==12,:height,) ),
"Solid",
"Medium Dark Red",
"Std Dev mean 12",
2
);
Report( gb )[AxisBox( 1 )] << Add Ref Line(
Col Min( if(:age == 12,:height,.) ),
"Solid",
"Medium Dark Red",
"Min 12",
2
);
Report( gb )[AxisBox( 1 )] << Add Ref Line(
Col Max( if(:age == 12,:height,.) ),
"Solid",
"Medium Dark Red",
"Max 12",
2
);
Report( gb )[AxisBox( 1 )] << Add Ref Line(
Col Mean( if(:age == 13,:height,.) ) + 4*Col Std Dev( If(:age==13,:height,) ),
"Solid",
"Medium Dark Red",
"Std Dev mean 13",
2
);
Re: Come posso cambiare linea di riferimento? nessun numerico@txnelson
Grazie per la tua gentile risposta!
Ne ho un altro ultimo! domanda.
scusa se ti disturbo..
Vorrei aggiungere la linea di riferimento Max, min (Mean + 4 * Std dev) in all grouop(age).
il problema è sotto lo script non funziona ..
names default to here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" ) ;
gb = Graph Builder(
Size( 1056, 825 ),
Variables( X( :height ), Group Y( :age ) ),
Elements(
Bar( X, Legend( 17 ) ),
Caption Box( X, Legend( 15 ), Response Axis( "X" ) ),
Caption Box(
X,
Legend( 16 ),
Response Axis( "X" ),
Summary Statistic( "Std Dev" )
)
)
);
Report( gb )[AxisBox( 1 )] << Add Ref Line(
Col Mean( :height ) + 4*Col Std Dev( :height ),
"Solid",
"Medium Dark Red",
"Std Dev mean",
2
);
e l'altro problema, come posso estrarre Max, Min (Mean + 4 * Std dev) tutto il gruppo (età).
Vorrei applicare la linea di riferimento Max (Mean + 4 * Std dev), Min (Mean + 4 * Std dev) allo stesso gruppo.
Penso di poter usare la funzione Max(), Min()...
Re: Come posso cambiare linea di riferimento? nessun numericoVedo il problema che stai sottolineando.Sembra che anche se l'albero di visualizzazione indica che ci sono 4 assi separati, JMP in realtà li tratta solo come 2 assi.Pertanto, ciò che deve essere fatto per avvicinarsi il più possibile a ciò che si desidera, è possibile prendere i dati per Altezza e Peso in 4 colonne, in base al valore del Sesso, e quindi tracciare le 4 variabili separatamente.

Ecco la JSL
names default to here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" ) ;
dtSplit = dt << Split(
Split By( :sex ),
Split( :height, :weight ),
Remaining Columns( Drop All ),
Sort by Column Property
);
gb = dtSplit << Graph Builder(
Variables( Y( :height F ), Y( :weight F ), Y( :height M ), Y( :weight M ) ),
Elements(
Position( 1, 1 ),
Points( Y, Legend( 11 ) ),
Caption Box( Y, Legend( 15 ), Summary Statistic( "Std Dev" ) )
),
Elements(
Position( 1, 2 ),
Points( Y, Legend( 12 ) ),
Caption Box( Y, Legend( 16 ), Summary Statistic( "Std Dev" ) )
),
Elements(
Position( 1, 3 ),
Caption Box( Y, Legend( 17 ), Summary Statistic( "Std Dev" ) ),
Points( Y, Legend( 18 ) )
),
Elements(
Position( 1, 4 ),
Points( Y, Legend( 14 ) ),
Caption Box( Y, Legend( 19 ), Summary Statistic( "Std Err" ) )
),
SendToReport(
Dispatch(
{},
"weight F",
ScaleBox,
{Min( 49.5141101773061 ), Max( 150.319351489306 ), Inc( 20 ),
Minor Ticks( 0 )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
18,
Properties( 0, {Line Color( 21 )}, Item ID( "height M", 1 ) )
), Legend Model(
14,
Properties( 0, {Line Color( 19 )}, Item ID( "weight M", 1 ) )
)}
),
Dispatch(
{},
"400",
LegendBox,
{Legend Position( {11, [0], 12, [1], 18, [3], 14, [2]} ),
Position( {0, 1, 3, 2} )}
)
)
);
Report( gb )[AxisBox( 2 )] << Add Ref Line(
Col Std Dev( :Height F ),
"Solid",
"Medium Dark Red",
"Std Dev mean",
2
);
Report( gb )[AxisBox( 3 )] << Add Ref Line(
Col Std Dev( :Weight F),
"Solid",
"Medium Dark Red",
"Std Dev mean",
2
);
Report( gb )[AxisBox( 4 )] << Add Ref Line(
Col Std Dev( :Height M ),
"Solid",
"Medium Dark Red",
"Std Dev mean",
2
);
Report( gb )[AxisBox( 5 )] << Add Ref Line(
Col Std Dev( :Weight M ),
"Solid",
"Medium Dark Red",
"Std Dev mean",
2
);Re: Come posso cambiare linea di riferimento? nessun numerico@txnelson
Grazie per la tua risposta.
Nello script seguente, tutti i valori STD nel gruppo F sono scritti come valori STD del gruppo M.
Come possiamo separarli in due gruppi?
dt = Open( "$SAMPLE_DATA/Big Class.jmp" ) ;
gb = Graph Builder(
Size( 1056, 825 ),
Variables( Y( :height ), Y( :weight ), Group Y( :sex ) ),
Elements(
Position( 1, 1 ),
Points( Y, Legend( 7 ) ),
Caption Box( Y, Legend( 13 ), Summary Statistic( "Std Dev" ) )
),
Elements(
Position( 1, 2 ),
Points( Y, Legend( 8 ) ),
Caption Box( Y, Legend( 14 ), Summary Statistic( "Std Dev" ) )
)
);
Report( gb )[AxisBox( 2 )] << Add Ref Line(
Col Std Dev( If( :sex == "F", :Height, . ) ),
"Solid",
"Medium Dark Red",
"Std Dev mean",
2
);
Report( gb )[AxisBox( 3 )] << Add Ref Line(
Col Std Dev( If( :sex == "F", :Height, . ) ),
"Solid",
"Medium Dark Red",
"Std Dev mean",
2
);
Report( gb )[AxisBox( 4 )] << Add Ref Line(
Col Std Dev( If( :sex == "M", :Height, . ) ),
"Solid",
"Medium Dark Red",
"Std Dev mean",
2
);
Report( gb )[AxisBox( 5 )] << Add Ref Line(
Col Std Dev( If( :sex == "M", :Weight, . ) ),
"Solid",
"Medium Dark Red",
"Std Dev mean",
2
);
Re: Come posso cambiare linea di riferimento? nessun numericoCome si può vedere nella mia risposta precedente, per aggiungere una linea di riferimento, tutto ciò che devi fare è passare un messaggio << Aggiungi linea di riferimento all'asse a cui vuoi aggiungere la linea di riferimento:
Report( gb )[AxisBox( 2 )] << Add Ref Line( Col Std Dev( :Height ), "Solid", "Medium Dark Red", "Std Dev mean", 2 );
Per scoprire a quale asse puntare correttamente, è necessario esaminare la struttura ad albero dell'output del Costruttore di grafici.Per fare ciò, fai clic con il pulsante destro del mouse sul triangolo grigio accanto all'intestazione del Generatore di grafici e seleziona
Modifica==>Mostra struttura ad albero


Quindi è possibile allineare la finestra del grafico con la finestra della struttura ad albero e fare clic sull'elemento nella finestra del grafico per il quale si desidera visualizzare la struttura ad albero e JMP si sposterà su tale struttura nella finestra della struttura ad albero

Come si può vedere qui, la colonna Axis for the Height, per Sex=="F" è AxisBox(2)
Se fai clic su ciascuno degli assi in questione, vedrai a quale casella dell'asse puntare per aggiungere una linea di riferimento.L'ultimo asse della domanda, colonna Peso, per Sex=="M" è:

Ora tutto ciò che deve essere fatto è espandere la JSL per creare le linee di riferimento per tutti e 4 gli assi e calcolare in ciascuno dei messaggi Add Ref Line, il valore corretto per il posizionamento della linea di riferimento.Ecco le 4 righe di codice Add Ref Line:
Report( gb )[AxisBox( 3 )] << Add Ref Line(
Col Std Dev( If( :sex == "F", :Weight, . ) ),
"Solid",
"Medium Dark Red",
"Std Dev mean",
2
);
Report( gb )[AxisBox( 2 )] << Add Ref Line(
Col Std Dev( If( :sex == "M", :Height, . ) ),
"Solid",
"Medium Dark Red",
"Std Dev mean",
2
);
Report( gb )[AxisBox( 3 )] << Add Ref Line(
Col Std Dev( If( :sex == "M", :Weight, . ) ),
"Solid",
"Medium Dark Red",
"Std Dev mean",
2
);
Si noti che in questo caso, la colonna Sesso doveva essere presa in considerazione per il calcolo della Deviazione Standard, insieme alla colonna di misurazione.
Re: Come posso cambiare linea di riferimento? nessun numerico@txnelson Grazie per la tua pronta risposta!
Ho un'altra domanda.
Se i dati sono stati raggruppati per sesso come nell'immagine sottostante, come posso gestirli?
Re: Come posso cambiare linea di riferimento? nessun numericoEcco una semplice modifica al tuo script che disegna una linea di riferimento al valore di Std Dev per ogni colonna (: Altezza,: Peso)
dt = Open( "$SAMPLE_DATA/Big Class.jmp" ) ;
gb=Graph Builder(
Size( 1056, 825 ),
Variables( Y( :height ), Y( :weight ) ),
Elements(
Position( 1, 1 ),
Points( Y, Legend( 7 ) ),
Caption Box( Y, Legend( 13 ), Summary Statistic( "Std Dev" ) )
),
Elements(
Position( 1, 2 ),
Points( Y, Legend( 8 ) ),
Caption Box( Y, Legend( 14 ), Summary Statistic( "Std Dev" ) )
)
);
report(gb)[AxisBox(2)]<<ADD ref="" line=""></ADD>