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

posted by Helmut Homepage – Vienna, Austria, 2009-10-05 16:53 (5735 d 09:09 ago) – Posting: # 4297
Views: 34,182

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,673 registered users;
76 visitors (0 registered, 76 guests [including 58 identified bots]).
Forum time: 02:02 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