2つのデータセットがあります。1つは、毎週または隔週でプロットで行われた昆虫数の平均です。もう1つは、毎週測定された歩留まりです。収量に対する昆虫の影響を分析できるように、これら2つのデータ表を組み合わせようとしています。
私はこれを持っています:

そして私はこれをJMPで制作しようとしています。
44週目と45週目では単純にYield値を移動しますが、47週目では46週目と47週目からYieldを合計する必要があります。49週も同じです。52週目は、50〜52週目の収穫高を合計します。
私はたくさんのプロットと不均一な数週間の昆虫と収穫のサンプリングをしています。
助けてくれてありがとう。
これはあなたが欲しいものを手に入れる一つの方法です。
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");