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

posted by Helmut Homepage – Vienna, Austria, 2009-10-05 16:53 (6091 d 12:14 ago) – Posting: # 4297
Views: 45,844

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,653 posts in 4,991 threads, 1,570 registered users;
122 visitors (0 registered, 122 guests [including 29 identified bots]).
Forum time: 05:07 CEST (Europe/Vienna)

In theory, there is no difference between theory and practice.
But, in practice, there is.    Jan L.A. van de Snepscheut

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