# NOT RUN {
## Assume you want to conduct a single-case study with 15 MTs, using a highly reliable test,
## an expected level effect of \eqn{d = 1.4}, and randomized start points between MTs 5
## and 12 can you expect to identify the effect using plm or randomization test?
mc_par <- list(
n_cases = 1, mt = 15, B.start = round(runif (300,5,12)),
rtt = 0.8, level = 1.4
)
res <- power.testSC(
parameters = mc_par,
stat = c("rand.test","hplm"),
test.parameter = "level",
startpoints = 5:12,
n_sim = 100
)
## Would you achieve higher power by setting up a MBD with three cases?
mc_par <- list(
n_cases = 3, mt = 15, B.start = round(runif (300,5,12)),
rtt = 0.8, level = 1.4
)
power.testSC(
parameters = mc_par,
stat = c("rand.test","hplm"),
test.parameter = "level",
startpoints = 5:12,
n_sim = 10
)
# }
Run the code above in your browser using DataLab