Sims [🇷 for BE/BA]

posted by Helmut Homepage – Vienna, Austria, 2010-04-27 03:36 (5103 d 03:25 ago) – Posting: # 5242
Views: 55,599

Dear D. Labes,

you have already outed yourself as a passionate wheel-reinventer, but why don't you simply go with the Welch-test (orwhatsover for unequal variances)? Since our Capt'n luuuvs simulations, I recycled some of his code to play width:
sims   <- 10000
MeanT  <- 95
MeanR  <- 100
CVT    <- 0.25
CVR    <- 0.40
nCons  <- 0
nAnti  <- 0
nT     <- 12
nR     <- 10
for (iter in 1:sims)
  {
    lnPKT  <- rnorm(n=nT,mean=MeanT,sd=CVT*MeanT)
    lnPKR  <- rnorm(n=nR,mean=MeanR,sd=CVR*MeanR)
    WelchRes <- t.test(lnPKT,lnPKR,conf.level=0.9)
    TtestRes <- t.test(lnPKT,lnPKR,var.equal=TRUE,conf.level=0.9)
    WidthW <- abs(WelchRes$conf.int[1]-WelchRes$conf.int[2])
    WidthT <- abs(TtestRes$conf.int[1]-TtestRes$conf.int[2])
    if (WidthT<WidthW){
      nAnti <- nAnti+1
      }else{
      nCons <- nCons+1
    }
  }
result  <- paste(paste("t-test compared to Welch-test\n"),
          paste("Conservative = ", 100*nCons/sims, "%\n"),
          paste("Liberal = ", 100*nAnti/sims, "%\n"))
cat(result)

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,650 registered users;
58 visitors (1 registered, 57 guests [including 6 identified bots]).
Forum time: 07:02 CEST (Europe/Vienna)

You can’t fix by analysis
what you bungled by design.    Richard J. Light, Judith D. Singer, John B. Willett

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