Ri: formulaEcco la formula che mi è venuta in mente, che sembra funzionare.
If( Row() == 1,
value = 1;
counter = 1;
);
If( :X__1 != Lag( :X__1 ),
counter = 1;
While( :X__1 == :X__1[Row() + counter] | Row() + counter == N Rows( Current Data Table() ), counter++ );
value = counter;
,
value = .
);
value;
Ri: formulaCiao,
funziona alla grande!
Potresti spiegarmi cosa significa questo.
Se (: X__1! = Lag (: X__1),
...
contatore = 1; While (: X__1 ==: X__1 [Row () + counter] | Row () + counter == N Rows (Current Data Table ()), counter ++);
valore = contatore;
.
valore =.
);
valore;
Dove posso leggerlo o conoscerlo?
Molte grazie!
Ri: formulaTutte le informazioni sulle funzioni e le istruzioni nello script in questione sono disponibili nella Guida agli script disponibile nel menu a discesa Guida
Guida ==> Guida agli script della libreria di documentazione JMP
Spero che quanto segue aiuti a comprendere la formula
// The entire script will be run for each row in the
// in the data table
// On row 1 set default values
If( Row() == 1,
value = 1;
counter = 1;
);
// If the value of X__1 has changed check to see if
// more than one row has this new value of X__1
If( :X__1 != Lag( :X__1 ),
counter = 1;
While(
:X__1 == :X__1[Row() + counter]
|
Row() + counter == N Rows( Current Data Table() ),
counter
++);
value = counter;
,
// If this is not a row that has a new value of X__1
// then set the value to a missing value
value = .
);
// A JMP formula always takes the results of the last item
// processed, and makes that the value for the formula
// columns current row so by placing the variable that
// holds that value as the last item processed in the
// script, we ensure the correct value is placed into
// the data table
value;
formulaCiao,
Voglio calcolare da un file la lunghezza delle serie successive di ogni individuo.
Come posso calcolarlo in JMP Pro con la formula?
A mano ho già inserito alcune sequenze nella sequenza delle colonne.
X_4 = sequenza
Grazie.