I would like to solve for $\pi_1$ in equation 7.14 of Hayes and Moulton's Cluster Randomized Trials. I can't for the life of me remember how to do so. Here is a link to the equation.
$$
c = 2\;+\;(z_{\alpha/2}+z_{\beta})^2\frac{\pi_0(1-\pi_0)/m\;+\;\pi_1(1-\pi_1)/m\;+\;k_m^2(\pi_0^2+\pi_1^2)}{(\pi_0-\pi_1)^2} \tag{7.14}
$$
Here is the R script I wrote to calculate c as shown in equation 7.14:
# inputs
arms <- 2
alpha <- 0.05
tails <- 1
power <- 0.80
m <- 50 # observations per cluster
p0 <- 0.40 # true proportion in absence of treatment
p1 <- 0.60 # true proportion in presence of treatment
km <- 0.25 # between-cluster coefficient of variation within strata
num <- (p0*(1-p0)/m) + (p1*(1-p1)/m) + (km^2*(p0^2+p1^2))
denom <- (p0 - p1)^2
x <- num/denom
c <- 2 + ( abs(qnorm(alpha/tails)) + qnorm(power) )^2*x
Could anyone help me to re-write this to calculate p1
given c
and all of the other variables? I'd be happy with a written formula that I can code if someone wants to help but not in R
.