Dear Detlew!

❝ Sometimes it would be helpful to RTFM .

Oh, I did. You will note that I hacked your code of CVp2CV() for my function sep2s().

❝ Note that the ratio is here the ratio of variances.

Exactly. But I was interested in the ratio of standard errors instead.

library(PowerTOST) sep2s <- function(CV, ratio=1) {   sp  <- CV2mse(CV)   swt <- sqrt(2)*sqrt(sp)*ratio/sqrt(ratio^2+1)   swr <- sqrt(2)*sqrt(sp)/sqrt(ratio^2+1)   r   <- se2CV(c(swt, swr))   return(r) } CV    <- 0.07 ratio <- 2 r1    <- CVp2CV(CV=CV, ratio=ratio) mse1  <- CV2mse(r1) se1   <- CV2se(r1) r2    <- sep2s(CV=CV, ratio=ratio) mse2  <- CV2mse(r2) se2   <- CV2se(r2) cat("Function CVp2CV()\n", "CV", CV, "split based on the variance ratio:", signif(r1, 3), "\n", "variances:", signif(mse1, 3), "ratio:", signif(mse1[1]/mse1[2], 3), "\n", "standard errors:", signif(se1, 3), "ratio:", signif(se1[1]/se1[2], 3), "\nFunction sep2s()\n", "CV", CV, "split based on the SE ratio:",  signif(r2, 3), "\n", "variances:", signif(mse2, 3), "ratio:", signif(mse2[1]/mse2[2], 3), "\n", "standard errors:", signif(se1, 3), "ratio:", signif(se2[1]/se2[2], 3), "\n")

Which gives:

Function CVp2CV()  CV 0.07 split based on the variance ratio: 0.0809 0.0571  variances: 0.00652 0.00326 ratio: 2  standard errors: 0.0807 0.0571 ratio: 1.41 Function sep2s()  CV 0.07 split based on the SE ratio: 0.0886 0.0442  variances: 0.00782 0.00196 ratio: 4  standard errors: 0.0807 0.0571 ratio: 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