Sample size calculation in clinical studies, how to use the formulas ?

Hello all

i’m a student in clinical research and i would like to learn how to calculate in Mathematica sample size in clinical research ,

based on :

  1. Alpha risk
  2. Power
  3. Delta( difference in efficiency of the drug A against drug b (reference drug) in %
  4. probable % loss in each group
  5. based on clinical study duration
  6. recruitment period ?

there are exampels like this simple one : Sealed Envelope | Power calculator for binary outcome superiority trial

how to use that formula in mathematica ? and how to add % loss and study duration variables ?
maybe someone used that before ?

thank You for this, i used R and SAS now i want to try to work with mathematica…

Sincerely, Denis.