f=function(mu) list(x=rnorm(25), y=rnorm(25, mu))
twosample_power(f, mu=c(0,2), B=100, maxProcessor = 1)
f=function(n, p) list(x=table(sample(1:5, size=1000, replace=TRUE)),
y=table(sample(1:5, size=n, replace=TRUE,
prob=c(1, 1, 1, 1, p))), vals=1:5)
twosample_power(f, n=c(1000, 2000), p=c(1, 1.5), B=100, maxProcessor = 1)
Run the code above in your browser using DataLab