# R: Sample size calculation for Logrank (survival test)

I have two groups of mice with tumors: a group treated and a group untreated. We know that after 4 weeks, the survival rate will be:

• 0% survival for the untreated mice (or 100% death rate)
• (we expect) at least 50% survival for the treated mice (or 0% to 50% death rate)

How can I know the number of mice needed for a study with a power=0.8 (1-β=0.8) and type.I.error α=0.05. Group ratio 1:1

I know that there is the LRPower function from LogrankPower Rpackage. But I am stuck, don't really know how to use it. I tried this:

>install.packages("Downloads/LogrankPower_1.0.0.tar.gz", repos = NULL, type = "source") #couldn't find it on the CRAN
>LRPower(total.sample.size=14, type.I.error = 0.05, effect.size=-log(99),
simulation.n=1000,group.sample.size.ratio=1, reference.group.incidence=0.999)


But I am very confused on what to use as effect.size and reference.group.incidence

And also know that there is the ssizeCT.default function from powerSurvEpi package

ssizeCT.default(power=0.8,k=1,pE=0.99999,pC=0.5,
RR= ??,alpha=0.05)


This time I am confused on what to put as RR ("the postulated hazard ratio") ?...

Could someone help or if you have another package or an open source software, i'll take it!

Instead of just jumping into particular implementations in software packages (mostly off-topic on this site anyway), think through the issues first.

First, if you actually "know" that no untreated mice can survive through 4 weeks, then having ANY survival in the treated group at 4 weeks would show superiority of treatment and you wouldn't need a control group of untreated mice. If your lower-limit estimate of survival of treated mice is 0.5, then the probability of finding 0 surviving treated mice out of N mice is no more than 0.5^N. If you just want an 80% chance of finding any surviving treated mice, then N=3 gives (1-0.5^3) = 0.875, or 87.5% power.

As you are specifying an untreated control group, I assume that you expect, not "know," that no untreated mice survive to 4 weeks.

Second, if you do expect 0 survival in the untreated group, then that group will have an estimated infinite hazard ratio versus a treated group that has any non-zero probability of survival. So any function that expects a finite hazard ratio or effect size will balk at giving you an estimate.

Third, you don't have estimates about the times at which the deaths occur anyway, only their estimated proportions at 4 weeks. So a test based on survival probabilities at that time is reasonable. (With only 1 survival time, 2 groups, and no loss to follow-up, the log-rank test is just a test on a single 2 x 2 contingency table.)

The bsamsize() function in the R Hmisc package is one way to estimate needed sample sizes in that situation, using normal approximations to get the limits for type I and type II errors. With event probabilities of 1 and 0.5 in the groups and equal group size, it calls for 10.51 per group under your specified type I and type II errors. So you would choose 11 in each group.

But how sure are you that no untreated mice will survive? What if there's just a 5% chance of survival? Did you have enough power in your observations of untreated mice? For example, there's a 21% ((1-0.05)^30) chance of finding no survivals among 30 mice having 5% survival probabilities. Power calculations to "rule out" a 5% chance of survival by finding no survivors: 32 mice for > 80% power, 45 for > 90% power.

If you assume 5% untreated survival to be a bit safer, you get 14.2 per group (so you use 15) with bsamsize(0.95,0.5).

The point is that power calculations are sensitive to details of your assumptions, more critical considerations than which program and function arguments to use.