Answering an un­asked ques­tion [RSABE / ABEL]

posted by Helmut Homepage – Vienna, Austria, 2015-07-02 15:03 (3211 d 13:11 ago) – Posting: # 15016
Views: 27,976

Dear Detlew!

❝ Sometimes it would be helpful to RTFM :-D.


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

❝ 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 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

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

Complete thread:

UA Flag
Activity
 Admin contact
22,984 posts in 4,822 threads, 1,654 registered users;
50 visitors (0 registered, 50 guests [including 7 identified bots]).
Forum time: 04:14 CEST (Europe/Vienna)

Complex, statistically improbable things are by their nature
more difficult to explain than
simple, statistically probable things.    Richard Dawkins

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5