Sims [🇷 for BE/BA]

posted by Helmut Homepage – Vienna, Austria, 2010-04-27 03:36 (5532 d 14:29 ago) – Posting: # 5242
Views: 62,170

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
23,424 posts in 4,927 threads, 1,677 registered users;
43 visitors (0 registered, 43 guests [including 12 identified bots]).
Forum time: 18:06 CEST (Europe/Vienna)

Philosophy, like medicine, has plenty of drugs, few good remedies,
and hardly any specific cures.    Sebastien-Roch Nicolas de Chamfort

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