This is an R program that calculates the sample size required for data that will be analyzed by logistic regression. It is written by Jaymie Strecker and implements formulas by Hsieh, Bloch, and Larsen. You can read more about these formulas in Appendix B and Section 4.4.8 of my dissertation.
Files to download:
To see usage information, run the program with no arguments to R (nothing after --args). For example:
R --no-save --slave --args < logistic_sample_size.R
To calculate the sample size for the example data file (above), run the program like this:
R --no-save --slave --args data_for_sample_size2.R < logistic_sample_size.R
This is the output you should get:
Dependent variable: Det
Sample size for each independent at each effect size:
0.318 0.477 0.953
LineCov 544 242 61
NormEvents 1201 534 134
NormE2Cov 1198 533 133
MutType 399 399 399
NormMaxEventSuccs 664 295 74
NormMinLinesCovBefore 580 258 65
NormMinLinesCovWith 593 263 66
AllRepeat 926 926 926
Maximum sample size at each effect size:
0.318 0.477 0.953
max 1201 926 926
If you have any questions or notice any bugs, please e-mail me at the address given on my home page.