T1E after 1st stage in TSDs [Two-Stage / GS Designs]
Of course, ElMaestro is right.
There Can Be Only One.
❝ do I understand it right that if the study is terminated after 1st stage (due to any reason), we are using the same function with n1 (not fixing n2 to 0)
Not sure what you mean. For any of the simulated studies the decision scheme of the method is followed. The function returns counters for the studies passing in the 1st stage (
pBE_s1
) and of the pooled data in the 2nd stage (pBE
). We can extract all numbers:library(Power2Stage)
# using defaults of method = "B"
tmp <- power.tsd(CV = 0.2, n1 = 12, theta0 = 1.25)
if (tmp$theta0 == tmp$theta1 | tmp$theta0 == tmp$theta2) {
txt <- "Type I Error"
} else {
txt <- "Power"
}
cat(formatC(tmp$nsims, digits = 7, big.mark = ","),
"simulated studies\nFailed in stage 1 :",
formatC(tmp$nsims - tmp$nsims * tmp$pBE_s1 - tmp$pct_s2 / 100 * tmp$nsims,
digits = 6, big.mark = ","),
sprintf("(%7.4f%%)",
100 * (tmp$nsims - tmp$nsims * tmp$pBE_s1 - tmp$pct_s2 /
100 * tmp$nsims) / tmp$nsims),
"\nPassed in stage 1 :",
formatC(tmp$pBE_s1 * tmp$nsims, digits = 6, big.mark = ","),
sprintf("(%7.4f%%)", 100 * tmp$pBE_s1),
"\nProceeded to stage 2 :",
formatC(tmp$nsims * tmp$pct_s2 / 100, digits = 6, big.mark = ","),
sprintf("(%7.4f%%)", tmp$pct_s2),
"\nFailed in stage 2 :",
formatC(tmp$nsims * tmp$pct_s2 / 100 - (tmp$pBE -tmp$pBE_s1) * tmp$nsims,
digits = 6, big.mark = ","),
sprintf("(%7.4f%%)",
100 * (tmp$nsims * tmp$pct_s2 / 100 - (tmp$pBE -tmp$pBE_s1) * tmp$nsims) / tmp$nsims),
"\nPassed in stage 2 :",
formatC((tmp$pBE -tmp$pBE_s1) * tmp$nsims, digits = 6, big.mark = ","),
sprintf("(%7.4f%%)", 100 * (tmp$pBE -tmp$pBE_s1)),
"\nFailed in stage 1 or 2:",
formatC((1 - tmp$pBE) * tmp$nsims, digits = 6, big.mark = ","),
sprintf("(%7.4f%%)", 100 * (1 - tmp$pBE)),
"\nPassed in stage 1 or 2:",
formatC(tmp$pBE * tmp$nsims, digits = 6, big.mark = ","),
sprintf("(%7.4f%%) = empiric", 100 * tmp$pBE), txt, "\n")
1,000,000 simulated studies
Failed in stage 1 : 92,550 ( 9.2550%)
Passed in stage 1 : 28,849 ( 2.8849%)
Proceeded to stage 2 : 878,601 (87.8601%)
Failed in stage 2 : 861,177 (86.1177%)
Passed in stage 2 : 17,424 ( 1.7424%)
Failed in stage 1 or 2: 953,727 (95.3727%)
Passed in stage 1 or 2: 46,273 ( 4.6273%) = empiric Type I Error
And:
tmp <- power.tsd(CV = 0.2, n1 = 12, theta0 = 0.95)
100,000 simulated studies
Failed in stage 1 : 2,325 ( 2.3250%)
Passed in stage 1 : 41,333 (41.3330%)
Proceeded to stage 2 : 56,342 (56.3420%)
Failed in stage 2 : 13,409 (13.4090%)
Passed in stage 2 : 42,933 (42.9330%)
Failed in stage 1 or 2: 15,734 (15.7340%)
Passed in stage 1 or 2: 84,266 (84.2660%) = empiric Power
❝ ❝
PS: I changed the category from . Though you asked for the -package
Power2Stage
, perhaps somebody would have the balls to roll out own code. ❝
❝ I changed the category twice when wrote the post
I see. Feel free to change it to anyone you like.
Dif-tor heh smusma 🖖🏼 Довге життя Україна!
Helmut Schütz
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Complete thread:
- T1E after 1st stage in Power2Stage mittyri 2022-06-24 13:43 [Two-Stage / GS Designs]
- T1E after 1st stage in TSDs Helmut 2022-06-24 14:33
- T1E after 1st stage in TSDs mittyri 2022-06-24 21:12
- T1E after 1st stage in TSDsHelmut 2022-06-25 14:07
- Potvin C consequences mittyri 2022-06-25 23:29
- Potvin C consequences ElMaestro 2022-06-26 09:11
- Potvin C consequences mittyri 2022-06-27 13:45
- Potvin C consequences Helmut 2022-06-27 14:49
- from Potvin C to Inverse Normal mittyri 2022-06-27 17:13
- From Potvin C to Inverse Normal: history (and outlook?) Helmut 2022-06-27 18:54
- from Potvin C to Inverse Normal mittyri 2022-06-27 17:13
- Potvin C consequences ElMaestro 2022-06-27 17:13
- true CV ≠ observed CV mittyri 2022-06-27 17:22
- Potvin C consequences Helmut 2022-06-27 14:49
- Potvin C consequences mittyri 2022-06-27 13:45
- Potvin C consequences ElMaestro 2022-06-26 09:11
- Potvin C consequences mittyri 2022-06-25 23:29
- T1E after 1st stage in TSDsHelmut 2022-06-25 14:07
- T1E after 1st stage in TSDs mittyri 2022-06-24 21:12
- T1E after 1st stage in Power2Stage ElMaestro 2022-06-24 18:25
- T1E after 1st stage in Power2Stage mittyri 2022-06-24 21:05
- T1E after 1st stage in Power2Stage ElMaestro 2022-06-24 22:55
- T1E after 1st stage in Power2Stage mittyri 2022-06-24 21:05
- T1E after 1st stage in TSDs Helmut 2022-06-24 14:33