## Buffon's needle [Power / Sample Size]

Dear all!

I was interested how it works on real data. For this purpose I've calculated the power for ~50 real 2x2 successful studies. Of course sample size is too low to make any conclusions but the tendency is pretty similar. The results are below. Please correct me if my reasoning is wrong.

The GMR of Cmax follows the log­normal distribution (p=0.123, Shapiro-Wilk W test), Geometric Mean PE was 0.9824, and including plus-minus SD for log-tranformed data leads to 0.935-1.032. So assuming 94-95% in sample size calculation seems to be good at reflecting the expected ratio.

Mean CV was 20.5% (median 18.5%). The average a posteriori power was 86.21% (median 97.33%). The distribution was as follows:
   ≥ target    : 73.58%   ≥ achieved  : 67.92%   ≥ 0.90      : 62.26%   [0.95, 0.99]: 16.98%   ≥ 0.95      : 56.60%  That is in 26.42% successful studies post hoc power was less than 80%. Why not in 50%? I suppose it is connected with two facts: the real number of subjects is always greater than calculated because researches include drop-outs and there exists the restricted limit of minimum of subjects in the study.

I've reproduced the calculation performed by Helmut for CV=18.5%, GMR=98.24% and 10% and 20%-drop-out rates.
For 10% I got
   ≥ target    : 66.21%   ≥ achieved  : 61.56%   ≥ 0.90      : 40.83%   [0.95, 0.99]: 16.90%   ≥ 0.95      : 24.02% 
For 20%:
   ≥ target    : 79.65%   ≥ achieved  : 75.51%   ≥ 0.90      : 54.21%   [0.95, 0.99]: 23.58%   ≥ 0.95      : 34.09% 

Blue histogram is for real data (nbins=15). The higher rate for power close to 1 in real data should be connected with the redundant number of subjects in studies with low CV (for CV lower than 22% and GMR=0.95 the power would be greater than 80% when the involved number of subjects is more than 24).

P.S.
  if (length(packages[!inst]) > 0) install.packages(packages[!inst])
One needs "s" on the end of "package(s)"?
cat("Results of", nsims, "simulated studies:\n")); summary(res)
extra ")"?

Anticipating the question "but why"? First, the R, Detlew's and Helmut's code possibilities are really impressive! And second: to make sure again that a posteriori power is needless thing and it is waste of paper to include it in the report.