Funzioni aggiuntive per tabella riassuntiva tramite JSLVorrei sapere come posso ottenere tabelle riassuntive ma con statistiche aggiuntive.
Per esempio, Modalità() è una funzione che si può usare in una formula, ma non funziona:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Summary( Group( :Age ),
subgroup( :sex ),
Mode( :Height )); // Mode isntead of meanVorrei anche riassumere la tabella ottenendo l'ultimo o il primo numero del gruppo.
Tabella datiScriptingRe: Funzioni aggiuntive per tabella riassuntiva tramite JSLFWIW (e se conosci un po' di JSL), puoi fare questo tipo di cose:
Names Default To Here( 1 );
// Sample data
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// Invisible Distribution with 'By' group(s)
dist = dt << Distribution(Continuous Distribution(Column( :height ),Customize Summary Statistics(Mode(1))), By(:age, :sex), Invisible);
// Get the Summary Stats
dt2 = Report(dist[1])[TableBox(2)] << makeCombinedDataTable;
Report(dist[1]) << closeWindow;
// Retain only the Mode
dt3 = dt2 << Subset(Rows(dt2 << getRowsWhere(:Column 1 == "Mode")));
dt3 << setName("Mode Values");
Column(dt3, "Column 1") << setName("Statistic");
Column(dt3, "Column 2") << setName("Value");
Close(dt2, NoSave);
prenderei in considerazione anche il Lista dei desideri JMP .
Re: Funzioni aggiuntive per tabella riassuntiva tramite JSLCiao @FN ,
ci devono essere molti modi per ottenere ciò che stai chiedendo anche se la modalità non è un'opzione nel riepilogo della tabella. Puoi richiedere la Modalità nella tabella aggiuntiva delle statistiche di riepilogo nella piattaforma di distribuzione manualmente o facendo clic su come @ian_jmp suggerisce. Altrimenti, prova a utilizzare il componente aggiuntivo di brady_brady :
Componente aggiuntivo-riepilogo-esteso-statistiche-per-JMP che fa riferimento alla modalità dal menu.
in alternativa, prova il seguente script:
Names Default To Here( 1 );
// Open Data Table: Big Class.jmp
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// get frequencies for modes
dt2 = dt << Summary(
Group( :Age, :sex, :height ),
Link to original data table( 0 )
);
// delete all rows that are not modes
dt2 << select where( Or( :N Rows != Col Max( :N Rows, :age, :sex ), :N Rows == 1 ) );
dt2 << delete rows;
// indicate first and last values per group - Not min and max unless table is first sorted!!!
dt << New Column( "id age", Numeric, "Continuous", Format( "Best", 12 ), Formula( Sum( :age[Index( 1, Row() )] == :age ) ), eval formula, );
dt:id age << delete formula;
// remove all rows that are not first or last
dt << select where( And( :id age != Col Max( :id age, :age ), :id age != 1 ) );
dt << delete rows;
// create one table with all data and sort it
dt3 = dt << concatenate( dt2, Create source column );
dt3 << New Column( "Value",
Character,
"Ordinal",
Formula( If( :id age == 1, "First", :id age > 1, "Last", :N Rows > 1, "Mode" ) ),
Set Property( "Value Order", {Custom Order( {"First", "Mode", "Last"} ), Common Order( 0 )} ),
);
dt3 << sort( By( :age, :sex, :Value ), Order( Ascending ), replace table );
si prega di notare che nel caso della classe Grande, non tutti i gruppi hanno una modalità chiara. il mio approccio è stato quello di rimuoverlo, la frequenza più alta era pari a 1.
per favore fateci sapere se funziona o cosa necessita di miglioramenti.
Ron
Re: Funzioni aggiuntive per tabella riassuntiva tramite JSLBel trucco usando la piattaforma di distribuzione come un modo per ottenerli.
Ho aggiunto la richiesta qui.Estensione delle funzioni della tabella di riepilogo a qualsiasi funzione definita (ad es. mode, kurt, skew, ecc.)
Re: Funzioni aggiuntive per tabella di riepilogo tramite JSLStavo testando questo approccio e non è fattibile, temo.
JMP impiega troppo tempo per utilizzare le distribuzioni show durante il raggruppamento di molti elementi in una grande tabella (mezzo milione di righe e centinaia di colonne).
Al contrario, le funzioni predefinite nella tabella di riepilogo vengono calcolate molto velocemente.