roman_max
☆

Russia,
2024-02-09 22:08
(98 d 15:08 ago)

Posting: # 23860
Views: 1,461

## CV in parallel design [🇷 for BE/BA]

Hello Helmut!

within this code in PowerTOST
100*CVfromCI(alpha=0.05, lower=0.8450985339, upper=1.104975299, n=c(5,5), design="2x2x4")
if design is "parallel" it is a CVtotal? Am I right?

Edit: I made it a top-level post and changed the subject line and category. [Helmut]
Helmut
★★★

Vienna, Austria,
2024-02-10 01:30
(98 d 11:45 ago)

@ roman_max
Posting: # 23861
Views: 1,300

## PowerTOST: CV in different designs

Hi roman_max,

❝ within this code in PowerTOST

100*CVfromCI(alpha=0.05, lower=0.8450985339, upper=1.104975299, n=c(5,5), design="2x2x4")

❝ if design is "parallel" it is a CVtotal? Am I right?

Yes, you are.

For the record:
1. Any replicate design: $$\small{CV_\text{intra}}$$, assuming homoscedasticity ($$\small{s_\text{wT}^2\equiv s_\text{wR}^2}$$).
2. Any crossover and a paired design: $$\small{CV_\text{intra}}$$.
3. Parallel design: $$\small{CV_\text{total}}$$, assuming homoscedasticity ($$\small{s_\text{T}^2\equiv s_\text{R}^2}$$).
Note that the $$\small{s^2}$$ components in #1 and #3 cannot be calculated from the confidence interval. You need the raw data.

library(PowerTOST) CI      <- c(0.85, 1 / 0.85) n       <- 24 designs <- known.designs()[c(1, 13, 3:6, 8:9, 12, 7, 10:11), c(2:3, 9)] res     <- data.frame(design = designs$design, name = designs$name,                       n = rep(n, nrow(designs)), df = designs$df, lower = CI[1], upper = CI[2], CV = NA, type = c("total", rep("intra", nrow(designs) - 1))) for (j in 1:nrow(designs)) { res$CV[j] <- sprintf("%.2f%%", 100 * CI2CV(lower = res$lower[j], upper = res$upper[j], n = n,                                              design = res\$design[j])) } print(res, row.names = FALSE, right = FALSE)  design   name                        n  df    lower upper    CV     type  parallel 2 parallel groups           24 n-2   0.85  1.176471 23.50% total  paired   paired means                24 n-1   0.85  1.176471 33.75% intra  2x2x2    2x2x2 crossover             24 n-2   0.85  1.176471 33.69% intra  3x3      3x3 crossover               24 2*n-4 0.85  1.176471 34.47% intra  3x6x3    3x6x3 crossover             24 2*n-4 0.85  1.176471 34.47% intra  4x4      4x4 crossover               24 3*n-6 0.85  1.176471 34.73% intra  2x2x4    2x2x4 replicate crossover   24 3*n-4 0.85  1.176471 50.60% intra  2x4x4    2x4x4 replicate crossover   24 3*n-4 0.85  1.176471 50.60% intra  2x2x2r   Liu's 2x2x2 repeated x-over 24 3*n-2 0.85  1.176471 50.62% intra  2x2x3    2x2x3 replicate crossover   24 2*n-3 0.85  1.176471 40.20% intra  2x3x3    partial replicate (2x3x3)   24 2*n-3 0.85  1.176471 40.20% intra  2x4x2    Balaam's (2x4x2)            24 n-2   0.85  1.176471 16.50% intra

You can calculate $$\small{CV_\text{wR}}$$ from the upper expanded limit (irrespective of the design and sample size):

U <- 1.4319 cat(sprintf("%.2f%%", 100 * U2CVwR(U)), "\n") 50.00%

Dif-tor heh smusma 🖖🏼 Довге життя Україна!
Helmut Schütz

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
roman_max
☆

Russia,
2024-02-12 22:27
(95 d 14:49 ago)

@ Helmut
Posting: # 23862
Views: 1,194

## PowerTOST: CV in different designs

Hi Helmut!

Thanks for the confirmation and "refreshing" info about CVs.
roman_max
☆

Russia,
2024-02-13 20:38
(94 d 16:38 ago)

@ Helmut
Posting: # 23863
Views: 1,130

## PowerTOST: CV in different designs

Hi Helmut!

One more question in terms of CVintra: what is the algebra for parallel design? In your lectures I could only found for crossover... I expect the same question from our regulatory agency if they cannot find "the formula" in study protocol.
Helmut
★★★

Vienna, Austria,
2024-02-13 21:55
(94 d 15:20 ago)

@ roman_max
Posting: # 23864
Views: 1,126

## Formulas for parallel and 2×2×2 designs

Hi roman_max,

❝ One more question in terms of CVintra: what is the algebra for parallel design?

$$\small{CV_\text{intra}}$$ is unknown. You mean $$\small{CV_\text{total}}$$, right?

❝ In your lectures I could only found for crossover... I expect the same question from our regulatory agency if they cannot find "the formula" in study protocol.

I was never asked for by any agency since I derived the formulas in the late 80s… The algebra is simple. The CI depends on the point estimate, the t-value for given $$\alpha$$ / degrees of freedom, and the variance. Only the last is unknown. Work backwards. However, to satisfy your curiosity:
\eqalign{ PE&=\sqrt{CL_\text{lower}\times CL_\text{upper}}\\ s_1&=\frac{\log_e\,PE-\log_e\,CL_\text{lower}}{t_{1-\alpha,\,n_1+n_2-2}\;\sqrt{f\left(\tfrac{1}{n_1}+\tfrac{1}{n_2}\right)}}\\ s_2&=\frac{\log_e\,CL_\text{upper}-\log_e\,PE}{t_{1-\alpha,\,n_1+n_2-2}\;\sqrt{f\left(\tfrac{1}{n_1}+\tfrac{1}{n_2}\right)}}\\ CV&=\sqrt{\exp\left[\left(\frac{s_1+s_2}{2}\right)^2\right]-1} }The only difference of the formula for the parallel design to the one for the 2×2×2 design is the factor $$f$$ in the denominator of the $$s$$ calculations. For the parallel design it is $$1$$, whereas for the 2×2×2 design it is $$\small{{^1}/_{2}}$$. Note that $$s_1\sim s_2$$. The formulas above are algebraic transformations of those in my lectures and are implemented as such in the function CVfromCI() / CI2CV() of PowerTOST.
If you are interested in the source code, type CVfromCI in the console. In the function, the user can not only specify the Confidence Limits, but also one of them together with the Point Estimate. If $$\left|s_1-s_2\right|\,/\,\frac{s_1+s_2}{2}>0.1$$ (i.e., $$s_1$$ and $$s_2$$ are more than 10% apart), a warning is issued prompting the user to check their input. The code is more complicated than the one below because it handles all implemented designs and contains input checking.

The example of my previous post in Base 🇷:

CI <- setNames(c(0.85, 1 / 0.85), c("lower", "upper")) n  <- c(12, 12) f  <- setNames(c(1, 0.5), c("parallel", "2x2x2")) PE <- sqrt(CI[["lower"]] * CI[["upper"]]) s1 <- (log(PE) - log(CI[["lower"]])) / (qt(1 - 0.05, sum(n) - 2) * sqrt(f * sum(1 / n))) s2 <- (log(CI[["upper"]]) - log(PE)) / (qt(1 - 0.05, sum(n) - 2) * sqrt(f * sum(1 / n))) CV <- sqrt(exp(((s1 + s2) / 2)^2) - 1) print(100 * CV, digits = 4) parallel    2x2x2    23.50    33.69

To see $$f$$ of the implemented designs:

designs           <- PowerTOST::known.designs()[c(1, 13, 3:6, 8:9, 12, 7, 10:11),                                                 c(9, 2, 7)] names(designs)[3] <- " f" print(designs, row.names = FALSE, right = FALSE)  name                        design    f   2 parallel groups           parallel 1/1  paired means                paired   2/1  2x2x2 crossover             2x2x2    1/2  3x3 crossover               3x3      2/9  3x6x3 crossover             3x6x3    1/18  4x4 crossover               4x4      1/8  2x2x4 replicate crossover   2x2x4    1/4  2x4x4 replicate crossover   2x4x4    1/16  Liu's 2x2x2 repeated x-over 2x2x2r   1/4  2x2x3 replicate crossover   2x2x3    3/8  partial replicate (2x3x3)   2x3x3    1/6  Balaam's (2x4x2)            2x4x2    1/2

Dif-tor heh smusma 🖖🏼 Довге життя Україна!
Helmut Schütz

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
roman_max
☆

Russia,
2024-02-15 17:42
(92 d 19:34 ago)

@ Helmut
Posting: # 23865
Views: 950

## Formulas for parallel and 2×2×2 designs

Hi Helmut!

Thank you for the reply and useful explanations :) Especially for our regulator as well ))

❝ ❝ One more question in terms of CVintra: what is the algebra for parallel design?

❝ $$\small{CV_\text{intra}}$$ is unknown. You mean $$\small{CV_\text{total}}$$, right?

Of course, I meant CVtotal.
fethiye
☆

Colchester,
2024-02-23 08:11
(85 d 05:04 ago)

@ Helmut
Posting: # 23874
Views: 819

## PowerTOST: CV in different designs

Thanks for information