Histogram charlatanry [Two-Stage / GS Designs]
Dear Detlew!
THX for the premature praise. Unfortunately my code is just approximate (euphemism for quick & dirty):
Whereas correct is
If one wants to get the histograms right, download the source from CRAN and after the line
add
At the res-list change the last line to
Now the data needed to plot a histogram of the total sample size are accessible for further use:
![[image]](img/uploaded/image312.png)
I luf open source!
❝ Wow! That made me dumbfounded! Clever, clever.
❝
THX for the premature praise. Unfortunately my code is just approximate (euphemism for quick & dirty):
mean(N)
[1] 42.25025
Whereas correct is
power.2stage(CV=0.3, alpha=c(0.001, 0.0413), n1=24, print=F, details=F)$nmean
[1] 42.26836
If one wants to get the histograms right, download the source from CRAN and after the line
} # end stage 2 calculations
add
hist <- hist(ntot, plot=FALSE)
At the res-list change the last line to
nmean=mean(ntot), nrange=range(ntot), nperc=quantile(ntot, p=npct),
hist=hist)
Now the data needed to plot a histogram of the total sample size are accessible for further use:
CV <- 0.3
n1 <- 24
col <- "#AAF7FF"
alpha <- matrix(nrow=4, ncol=2, byrow=T, dimnames=list(
c("Haybittle/Peto 0.0010/0.0413",
"O\u2019Brien/Fleming 0.0050/0.0416",
"Zheng 0.0100/0.0412",
"Potvin 0.0302/0.0302"),
c("alpha1", "alpha2")))
alpha[1, ] <- c(0.001, 0.0413)
alpha[2, ] <- c(0.005, 0.0416)
alpha[3, ] <- c(0.010, 0.0412)
alpha[4, ] <- rep(0.0302, 2)
invisible(split.screen(c(2, 2)))
for(j in 1:nrow(alpha)) {
screen(j)
res <- power.2stage(CV=CV, alpha=alpha[j, ], n1=n1, print=F, details=F)
plot(res$hist, freq=F, xlim=c(12, 120), ylim=c(0, 0.1),
main=rownames(alpha)[j], xlab=expression(n[total]),
cex.main=0.95, cex.axis=0.9, col=col, las=1)
abline(v=c(res$nmean, res$nperc[["50%"]]), lty=c(1, 3))
legend("topright", box.lty=0, legend=c("mean", "median"), lty=c(1, 3),
cex=0.9)
}
close.screen(all.screens=T)
![[image]](img/uploaded/image312.png)
I luf open source!
—
Dif-tor heh smusma 🖖🏼 Довге життя Україна!![[image]](https://static.bebac.at/pics/Blue_and_yellow_ribbon_UA.png)
Helmut Schütz
![[image]](https://static.bebac.at/img/CC by.png)
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Dif-tor heh smusma 🖖🏼 Довге життя Україна!
![[image]](https://static.bebac.at/pics/Blue_and_yellow_ribbon_UA.png)
Helmut Schütz
![[image]](https://static.bebac.at/img/CC by.png)
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Complete thread:
- Does unequal alpha distribution make sense? Dr_Dan 2015-05-19 08:29 [Two-Stage / GS Designs]
- Maybe; but watch the TIE! Helmut 2015-05-28 15:04
- Advantages d_labes 2015-06-05 09:35
- Advantages ElMaestro 2015-06-05 10:07
- Advantages – performance measure d_labes 2015-06-05 11:21
- Advantages – performance measure Helmut 2015-06-05 13:29
- Advantages – performance measure d_labes 2015-06-05 21:27
- Advantages – performance measure Helmut 2015-06-05 23:29
- Histogram wonder d_labes 2015-06-06 12:58
- Histogram charlatanryHelmut 2015-06-09 13:43
- Histogram beauty d_labes 2015-06-09 14:55
- Histogram beast Helmut 2015-06-09 15:24
- Histogram beauty d_labes 2015-06-09 14:55
- Histogram charlatanryHelmut 2015-06-09 13:43
- Histogram wonder d_labes 2015-06-06 12:58
- Advantages – performance measure Helmut 2015-06-05 23:29
- Advantages – performance measure d_labes 2015-06-05 21:27
- Advantages – performance measure Helmut 2015-06-05 13:29
- Advantages – performance measure d_labes 2015-06-05 11:21
- Advantages ElMaestro 2015-06-05 10:07
- Advantages d_labes 2015-06-05 09:35
- Does unequal alpha distribution make sense? Dr_Dan 2015-05-29 08:33
- Does unequal alpha distribution make sense? ElMaestro 2015-05-29 09:31
- Does unequal alpha distribution make sense? nobody 2015-05-29 12:56
- Old beliefs die hard Helmut 2015-05-29 13:27
- Old beliefs die hard nobody 2015-05-29 13:41
- Old beliefs die hard Helmut 2015-05-29 18:08
- Old beliefs die hard ElMaestro 2015-05-29 18:57
- Old beliefs die hard nobody 2015-05-29 20:06
- ♩ ♪♫♬`·.¸¸.·´`·.¸¸. Helmut 2015-06-02 01:52
- TSD only an option in exceptional cases Dr_Dan 2015-06-02 08:00
- TSD only an option in exceptional cases nobody 2015-06-02 09:23
- TSD only an option in exceptional cases Dr_Dan 2015-06-02 08:00
- Old beliefs die hard ElMaestro 2015-05-29 18:57
- Old beliefs die hard Helmut 2015-05-29 18:08
- Old beliefs die hard nobody 2015-05-29 13:41
- Old beliefs die hard Helmut 2015-05-29 13:27
- Does unequal alpha distribution make sense? nobody 2015-05-29 12:56
- Does unequal alpha distribution make sense? ElMaestro 2015-05-29 09:31
- Banana splits Helmut 2015-06-02 00:48
- Maybe; but watch the TIE! Helmut 2015-05-28 15:04