# Sample size calculation for proportional odds model

Apologies in advance for my lack of statistical knowledge/insight!

I am trying to calculate the sample size for a clinical trial of treatment A versus placebo with primary outcome of prolongation of treatment time ('the longer the better'). We know that the primary outcome is skewed. The minimal clinically relevant treatment effect would be a difference of 5 days between the medians.

As suggested by prof. Harrell, I have tried calculating the sample size using a proportional odds model based on data from a similar (already published) trial. I based my calculations on this example: https://www.fharrell.com/post/pop/

However, I am unsure whether I have provided the right input for the functions popower and pomodm in R.

This is my code:

pwr.t.test(n=180/2, d=5/sd(p), type = 'two.sample') The previous trial had 180 patients in total (90 treatment A, 90 placebo); this yield a power of 44% to detect a difference of 5 days (in means) (two-sample t-test), which I think can be improved by using a proportional odds model instead.

p <- df_placebo\$prolongation in days, where p is a list of prolongation in days (non-integer, unique values) for each patient in the placebo group from the previous trial. Am I correct in only using placebo data for the sample size calculation?

kp <- table (p); kp <- kp /sum(kp), this is based on the example blog-post but I am not sure whether this is correct for my case or whether I should input a table of probabilities based on frequencies instead (which would be 1/90 for every 'prolongation level', as there are 90 patients in the placebo group and each 'prolongation' is a unique value.

kx <- as.numeric(names(kp))

library(Hmisc)

w <- pomodm(kx, kp, odds.ratio=1.0), this yields the original mean and median for the placebo group, which to me seems correct.

Next step to find out which OR corresponds to a difference in medians of 5 days between placebo and treatment group:

z <- data.table(or=ors)
u <- z[, as.list(pomodm(kx, kp, odds.ratio=or) - w), by=or]
m <- meltData(or ~ mean + median, data=u)
ggplot(m, aes(x=or, y=value, color=variable)) + geom_line() +
geom_vline(xintercept=1.29, alpha=0.3) +
geom_hline(yintercept=5) +
guides(color=guide_legend(title='')) +
xlab('Odds Ratio') + ylab('Difference Between Groups')


A five-day increase seems to correspond to an OR of 1.29. But if I input this into popower this yields a power of only 16% with 180 patients in total. popower(kp, odds.ratio=1.29, 180)

I am not sure what I am doing wrong. So sorry if this is not a very smart question; R and statistics are very new to me and I have just started learning more a few weeks ago by reading articles and blog posts.

Edited to show distribution of prolongation data (ln-transformed, blue = placebo, red = treatment A, from previous trial):

Prolongation data on the original scale (placebo and treatment A, respectively):

You've done a good job Catherina. Yes, the external data from a placebo group forms the reference data. table(p) / sum(table(p)) is the right vector; it is the relative frequencies. A minor issue is that popower wants you to provide relative frequencies that are averaged over control and treatment subjects. If you let $$a$$ be square root of the odds ratio, you can apply an odds ratio of $$a$$ to the placebo proportions to get the proportions for the between-treatment average. I wish I had used the control group for the proportions in popower and posamsize. To check the calculations you can apply an odds ratio of $$\frac{1}{a}$$ to the modified proportions to make sure you get the original placebo proportions.

The bigger questions are

• which effect size to use in computing power (mean vs. median)
• what is the real MCID, i.e., were the experts right in say a difference in medians of 5? Did they assume the mean and median were the same when selecting 5?

The only way I can think of to explore this is to find a transformation of p that yields a symmetric distribution, and solve for the difference in means on that transformed scale that corresponds to a difference in medians of 5 on the original scale. Compute the SD on that transformed scale and repeat pwr.t.test on the just-solved-for difference in means. That should be more comparable to popower.

• Thank you! Using the square root of the odds ratio to obtain relative frequencies averaged over control and treatment subjects indeed did not impact the power very much; still 15% when aiming for a difference of 5 days in medians (part I). Commented Apr 28 at 19:01
• The closest I could get to a symmetric distribution was by ln-transforming the data, althought the distribution was not log-normal. Then I did this: mean_placebo <- 2.25039457 # mean of log normal transformed data in previous trial mean_treatment <- log(exp(mean_placebo) + 5) #MCRD of 5 days on the untransformed scale (not sure if this is right) MCRD <- mean_treatment - mean_placebo #log-scale MCRD sd_log <- 1.23184 # Standard deviation on the log scale pwr.t.test(n=180/2, d=MCRD/sd_log, type = 'two.sample') This yields a power of 63%. Commented Apr 28 at 19:04
• I also tried doing the following: applied the OR matching a 5 day difference in medians on the data on the original scale, ln-transformed the data, calculated the difference in means on the transformed scale and the SD on the transformed scale and then repeated pwr.t.test with this difference in means. This yields a power of 11% (more comparable to popower`). Commented Apr 29 at 6:55
• Hard to figure out. In the graph above you show negative values of prolongation of treatment. How can that be? How did you take logs then? Commented Apr 29 at 11:10
• The graph with the red and blue lines are the ln-transformed data (sorry that wasn't clear; some prolongation times were really short, leading to negative values when ln-transformed). I have added descriptions of the untransformed data as well (for placebo and treatment A). Commented Apr 29 at 12:37