你好,
我有一个简单的例子,我们对一堆样本(在“变量 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)

我也可能错过或理解了一些错误的东西,而你想要一些不同的东西,如果是这样的话,你能提供一个包含正确结果的专栏吗?