【发布时间】:2019-11-29 04:16:55
【问题描述】:
在一个项目中,我在 CT 扫描仪中测量了不同偏离中心位置(列=Offcenter)(工作台高度)的肿瘤碘浓度(列=ROI_IC)。我知道每个肿瘤的真实浓度(列=Real_IC;有 4 种不同的肿瘤具有 4 种不同的 real_IC 浓度)。每个肿瘤在每个偏离中心的位置测量 10 次(列=Measurement_repeat)。我计算了测得的碘浓度和实际碘浓度之间的绝对误差(column=absError_IC)
这只是数据的头部:
Offcenter Measurement_repeat Real_IC ROI_IC absError_IC 1 0 1 0.0 0.4 0.4 2 0 2 0.0 0.3 0.3 3 0 3 0.0 0.3 0.3 4 0 4 0.0 0.0 0.0 5 0 5 0.0 0.0 0.0 6 0 6 0.0 -0.1 0.1 7 0 7 0.0 -0.2 0.2 8 0 8 0.0 -0.2 0.2 9 0 9 0.0 -0.1 0.1 10 0 10 0.0 0.0 0.0 11 0 1 0.4 0.4 0.0 12 0 2 0.4 0.3 0.1 13 0 3 0.4 0.2 0.2 14 0 4 0.4 0.0 0.4 15 0 5 0.4 0.0 0.4 16 0 6 0.4 -0.1 0.5 17 0 7 0.4 0.1 0.3 18 0 8 0.4 0.3 0.1 19 0 9 0.4 0.6 0.2 20 0 10 0.4 0.7 0.3现在我想创建一个名为 corrError_IC 的新列。
在此列中,测得的碘浓度 (ROI_IC) 应根据在 Offcenter = 0 处针对特定 Real_IC 浓度发现的平均绝对误差(10 次测量的平均值)进行校正
因为有 4 个肿瘤浓度,所以在偏离中心 =0 处有 4 个平均值,我想将其应用于其他偏离中心值。
mean1=mean of the 10 absError-IC measurements of the `Real_IC=0`
mean2=mean of the 10 absError-IC measurements of the `Real_IC=0.4`
mean3=mean of the 10 absError-IC measurements of the `Real_IC=3`
mean4=mean of the 10 absError-IC measurements of the `Real_IC=5`
基本上,我希望特定肿瘤的平均绝对误差为Offcenter = 0(有 4 种不同的肿瘤类型和四种不同的 Real_IC),然后我想通过这个绝对误差值校正其他偏心位置的所有肿瘤源自Offcenter = 0 数据。
我尝试了ifelse 语句,但我无法弄清楚。
编辑: 偏心有特定级别:c(-6,-4,-3,-2,-1,0,1,2,3,4,6)
【问题讨论】: