# NOT RUN {
# the termination thresholds are obtained from design.MSPRT()
## one-sample tests
### proportion test
x = c(0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0,
0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0)
implement.MSPRT(obs = x, test.type = "oneProp", null = 0.2,
term.thresh = 22.63, N.max = 30)
### Z-test
x = c(4.060319, 5.275465, 3.746557, 7.392921, 5.494262,
3.769297, 5.731144, 6.107487, 5.863672)
implement.MSPRT(obs = x, test.type = "oneZ", null = 3,
sigma0 = 1.5, term.thresh = 27.856, N.max = 30)
### T-test
x = c(1.738717, 5.076539, 1.116762, 3.105214, 5.567161, 2.095638,
2.291750, 2.046943, 2.571340, 3.207162, 4.841446, 1.797331)
implement.MSPRT(obs = x, test.type = "oneT", null = 3,
term.thresh = 33.152, N.max = 30)
## two-sample tests
### Z-test
x1 = c(0.6546282, 2.2772738, 4.3817680, 0.3044365, 1.8796224,
2.1986304, 3.0619321, 1.6404530, 4.9767109) # group-1
x2 = c(0.5570999, 1.5612114, 2.3881823, 0.2718022, 2.2936742,
2.0451859, 2.1281266, 3.6749153, 0.1717139) # group-2
implement.MSPRT(test.type = "twoZ", obs1 = x1, obs2 = x2,
sigma0 = 1.5, term.thresh = 27.928,
N1.max = 30, N2.max = 30)
### T-test
x1 = c(-0.93968072, 0.27546499, -1.25344292, 2.39292120, 0.49426166,
-1.23070258, 0.73114358, 1.10748706, 0.86367203, -0.45808258,
2.26767175, 0.58476485, -0.93186087, -3.32204983, 1.68739638,
-0.06740041, -0.02428539, 1.41575432, 1.23183179) # group-1
x2 = c( 0.6546282, 2.2772738, 4.3817680, 0.3044365, 1.8796224,
2.1986304, 3.0619321, 1.6404530, 4.9767109, 1.7918195,
2.6264761, 3.4726292, 1.4109570, 0.4404965, 4.6733434,
-1.4666036, 3.3179069, 2.0537101, 3.5192430) # group-2
implement.MSPRT(test.type = "twoT", obs1 = x1, obs2 = x2,
term.thresh = 32.972, N1.max = 30, N2.max = 30)
# }
Run the code above in your browser using DataLab