此代码使用pwr和ggplot2包在R中生成曲线。如何更改此曲线的颜色?
library(pwr)
library(ggplot2)
P0 = c(0.05,0.06,0.11,0.104,0.16,0.106,0.01,0.1,
0.1,0.1,0.08,0.02)
P1 = c(0.1,0.05,0.12,0.101,0.12,0.105,0.024,0.04,
0.01,0.11,0.04,0.06)
effect.size = ES.w1(P0, P1)
degrees = length(P0) - 1
pwr.chisq.test(
w=effect.size,
N=NULL,
df=degrees,
power=0.80,
sig.level=0.05)
P.out <- pwr.chisq.test(
w=effect.size,
N=NULL,
df=degrees,
power=0.80,
sig.level=0.05)
plot(P.out)
p <- plot(P.out)
p + theme_classic(base_size = 14)