下面是生成模拟数据的代码:
eff = seq(.1, 1, .1)
method = c('method1', 'method2')
xxxd = expand.grid(eff=eff, method=method)
xxxd$power = c(pow1, pow2)
pow1 = seq(.2, .7, length.out=10)
pow2 = seq(.4, .8, length.out=10)
pow1 = pow1 + rnorm(10, .05, .01)
pow2 = pow2 + rnorm(10, .05, .01)
xxxd$power = c(pow1, pow2)
这是数据:
eff method power
1 0.1 method1 0.25942
2 0.2 method1 0.32162
3 0.3 method1 0.36329
4 0.4 method1 0.41286
5 0.5 method1 0.47904
6 0.6 method1 0.52165
7 0.7 method1 0.58191
8 0.8 method1 0.64884
9 0.9 method1 0.69488
10 1.0 method1 0.73656
11 0.1 method2 0.44882
12 0.2 method2 0.49010
13 0.3 method2 0.54465
14 0.4 method2 0.58675
15 0.5 method2 0.63173
16 0.6 method2 0.69120
17 0.7 method2 0.71456
18 0.8 method2 0.77440
19 0.9 method2 0.81033
20 1.0 method2 0.85103
我想制作的图是这样的: