SAS -> R -> SAS [🇷 for BE/BA]

posted by Helmut Homepage – Vienna, Austria, 2009-10-05 16:53 (5738 d 12:54 ago) – Posting: # 4297
Views: 34,207

Dear D Labes,

❝ Implementing the Julious formulas (according to Helmut's R-code) in "The power to know" results in power=-0.027799235, same as Fartssie!


Funny!
My R-code was just ported from Patterson's/Jones' SAS-code. Tweaking the code to calculate power (haha) at n=38:

options(digits=8)
alpha  <- 0.05; CV <- 0.65; ratio <- 0.95; n <- 38
Theta1 <- 0.80; Theta2 <- 1/Theta1
s      <- sqrt(2)*sqrt(log(1+CV^2))
t1     <- qt(1-alpha,n-2)
nc1    <- sqrt(n)*(log(ratio)-log(Theta1))/s
nc2    <- sqrt(n)*(log(ratio)-log(Theta2))/s
prob1  <- pt(+t1,n-2,nc1)
prob2  <- pt(-t1,n-2,nc2)
power  <- prob2-prob1
power


I get -0.027799235, which is either an Ouroboros or another strong hint that SAS and R follow the same algorithm.

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,672 registered users;
60 visitors (0 registered, 60 guests [including 17 identified bots]).
Forum time: 05:48 CEST (Europe/Vienna)

Medical researches can be divided into two sorts:
those who think that meta is better and those
who believe that pooling is fooling.    Stephen Senn

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