Calculate within and between variances and confidence intervals in R

后端 未结 4 1590
误落风尘
误落风尘 2021-02-06 09:13

I need to calculate the within and between run variances from some data as part of developing a new analytical chemistry method. I also need confidence intervals from this data

4条回答
  •  太阳男子
    2021-02-06 09:59

    If you want to apply a function (such as var) across a factor such as Run or Rep, you can use tapply:

    > with(variance, tapply(Value, Run, var))
              1           2           3           4 
    0.005833333 0.310000000 0.610000000 0.043333333 
    > with(variance, tapply(Value, Rep, var))
              1          2          3 
    0.48562500 0.88729167 0.05583333 
    

提交回复
热议问题