¿Cómo calcular rápidamente el número total de valores de columna> 2?El cálculo parece simple, pero no entendí la forma rápida:
Calcule el número total de> 2 en cada columna y obtenga la nueva tabla.
¡Gracias!
dt = Open( "$SAMPLE_DATA\Data\Missing Data Pattern.jmp" );

ScriptingRe: ¿Cómo calcular rápidamente el número total de valores de columna> 2?Por favor encuentre una forma (sin duda de muchas). Utilice 'Ayuda> Índice de secuencias de comandos' para averiguar cómo funciona y cómo mejorarlo.
NamesDefaultToHere(1);
// Make a table with some (integer) values
nr = 10;
nc = 5;
dt = AsTable(J(nr, nc, RandomInteger(1, 5)));
dt << setName("Integers Between 1 and 5");
// Start here . . .
dt = CurrentDataTable();
// Get the data into a matrix
m = dt << getAsMatrix;
// Only keep values above the threshold (of 2)
m[Loc(m <= 2)] = .;
// Set all remaining values to 1
m =!IsMissing(m);
// Sum every column, and make a table
dt2 = AsTable(VSum(m));
dt2 << setName("Number of Values Above 2");