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

posted by Helmut Homepage – Vienna, Austria, 2009-10-05 16:53 (5734 d 23:07 ago) – Posting: # 4297
Views: 34,175

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,671 registered users;
29 visitors (0 registered, 29 guests [including 20 identified bots]).
Forum time: 16:01 CEST (Europe/Vienna)

Truth and clarity are complementary.    Niels Bohr

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