Ho due set di dati. Uno è una media dei conteggi degli insetti che sono stati fatti in una trama settimanale o bisettimanale. L'altro è il rendimento che è stato misurato ogni settimana. Sto cercando di combinare queste due tabelle di dati in modo da poter analizzare l'impatto degli insetti sul rendimento.
Ho questo:

E sto provando a produrre questo in JMP.
Si noti che per la settimana 44 e 45 ho semplicemente spostato il valore del rendimento su, ma per la settimana 47 ho bisogno di sommare la resa dalle settimane 46 e 47. Lo stesso per la settimana 49. Per la settimana 52 sommato il rendimento delle settimane 50-52.
Ho molti complotti e settimane irregolari di campionamento di insetti e rese.
Grazie per tutto l'aiuto.
Ecco un metodo per ottenere quello che vuoi
names default to here(1);
dtInsects = New Table( "Insects",
Add Rows( 10 ),
New Column( "Week",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [39, 40, 41, 42, 43, 44, 45, 47, 49, 52] )
),
New Column( "Plot#",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[59.01, 59.01, 59.01, 59.01, 59.01, 59.01, 59.01, 59.01, 59.01, 59.01]
)
),
New Column( "Insects",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [0, 0.2, 0.2, 3.6, 15.4, 2.6, 0.3, 0.3, 0.3, 0.7] )
)
);
dtYields = New Table( "Yields",
Add Rows( 9 ),
New Column( "Week",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [44, 45, 46, 47, 48, 49, 50, 51, 52] )
),
New Column( "Plot#",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[59.01, 59.01, 59.01, 59.01, 59.01, 59.01, 59.01, 59.01, 59.01]
)
),
New Column( "Yield",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[130.96, 343.1, 466.2, 903.59, 2611.25, 1052.88, 1335.74, 1414.32,
500.25]
)
)
);
// Join the data
dtTogether = dtInsects << Join(
With( dtYields ),
Merge Same Name Columns,
By Matching Columns( :Week = :Week, :Plot# = :Plot# ),
Drop multiples( 0, 0 ),
Include Nonmatches( 1, 1 ),
Preserve main table order( 0 ),
Output Table( "All Together" )
);
dtTogether << New Column( "Calculated Yield",
formula(
rowNum = Row() - 1;
cumSum = :Yield;
If( Is Missing( :Yield ) == 0,
While( :Match Flag[rowNum] == 2,
cumSum = cumSum + :Yield[rowNum];
rowNum--;
)
);
cumSum;
)
);
// Make formula columns static values
dtTogether:Calculated Yield << delete formula;
// Delete rows that only came from the With Data Table
dtTogether << select where( :Match Flag == 2 ) << delete rows;
// Delete the Match Flag column
dtTogether << delete columns("Match Flag");