你好,
我有一個簡單的例子,我們對一堆樣本(在“變量 x”列中)進行動力學(在“時間(分鐘)”列中)。 我需要創建一個新列來運行累積總和,該總和說明“變量 x”中列出的每個樣本所花費的時間。 我嘗試了 col 累積和函數,但它沒有實現目標。
我懷疑一個好的方法是使用行、滯後或偏移,但我不知道如何將它們組合在一起。 我附上了一個
names default to here(1);
New Table( "noci",
Add Rows( 8 ),
New Column( "variable X",
Character,
"Nominal",
Set Values( {"a", "a", "a", "a", "b", "b", "b", "b"} )
),
New Column( "Time (min)",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [1, 2, 3, 4, 1, 2, 3, 4] )
),
New Column( "Nociception Data",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [1, 2, 1, 2, 3, 1, 2, 1] )
),
New Column( "Cumulative nociception as function of ellapse time",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [1, 3, 4, 6, 3, 4, 6, 7] )
)
)示例數據表
任何讓我走上正軌的意見將不勝感激!
最好的
塞巴斯蒂安
嗨布雷迪,
這不是最優雅的解決方案,但它會起作用。 但我還是希望我能想到這一點
最好的,
塞巴斯蒂安
為什麼 Col Cumulative Sum() 沒有達到目標? 如果“累積傷害感受作為經過時間的函數”具有您想要的值,則 col 累積總和似乎有效。
Col Cumulative Sum(:Nociception Data, :variable X)

我也可能錯過或理解了一些錯誤的東西,而你想要一些不同的東西,如果是這樣的話,你能提供一個包含正確結果的專欄嗎?