Potvin – all effects fixed (PHX/WNL vs. SAS, R) [Two-Stage / GS Designs]

posted by ElMaestro  – Denmark, 2012-10-27 00:05 (4622 d 16:25 ago) – Posting: # 9465
Views: 11,633

Hi Helmut,

check your coding, I thik there's an issue with seq.

I get:
Subj=as.factor(c(1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,
         11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20))
Seq=as.factor(c("TR","TR","TR","TR","TR","TR",   
                "TR","TR","TR","TR","TR","TR", 
                "RT","RT","RT","RT","RT","RT",
                "RT","RT","RT","RT","RT","RT",
                "TR","TR","TR","TR",
                "TR","TR","TR","TR",
                "RT","RT","RT","RT",
                "RT","RT","RT","RT"))
Per=as.factor((rep(c(1,2), 20)))
Trt=as.factor(c(1,2,1,2,1,2,1,2,1,2,1,2,
                2,1,2,1,2,1,2,1,2,1,2,1,
                1,2,1,2,1,2,1,2,
                2,1,2,1,2,1,2,1))
Stg=as.factor(c(rep(1,24), rep(2,16)))

PK=c(4.8, 4.6, 1.4, 1.3, 3.9, 4.4, 1.5, 2.4, 3.8, 2.9, 3.3, 2.5, 1.7, 1.5, 1.3, 1.9, 2.1, 2.4, 11.4, 13.9, 1.5, 2.3, 2.6, 2.4,
4.0,4.2,0.7, 0.5, 10.3, 11.9,4.7, 4.8, 5.9,5.5, 3.8, 5.4, 4.3, 2.1, 3.6, 2.4)
options(digits=12)
M=lm(log(PK)~0+Trt+Seq+Subj%in%(Stg*Seq)+Per%in%Stg+Stg)
lnPE=coef(M)[1]-coef(M)[2]
df=anova(M)[6,1]
ct=qt(1-0.0294,df)
nps=length(Trt)/4
foo=sqrt(0.5*(anova(M)[6,3])* (1/nps+1/nps)   ) 
U=lnPE+ct*foo
L=lnPE-ct*foo 
cat("Difference in treatment means is ", coef(M)[1]-coef(M)[2], "\n")
Difference in treatment means is  0.01443888498
cat("PE: ", exp(lnPE), "\n")
PE:  1.01454362920
> cat("The residual is ", anova(M)[6,3], "\n")
The residual is  0.0458955516532
cat("Upper ", exp(U), "\n")
Upper  1.16377016091
cat("Lower ", exp(L), "\n")
Lower  0.88445193916



We have a winner?


PS: With that coding for subject we will of course not talk about subject nested in sequence or stage :-D:-D:-D. There is no subject 1 in sequence "RT" and no subject 1 in stage 2 and so forth. So we might just as well do:
M=lm(log(PK)~0+Trt+Stg+Seq+Subj+Per%in%Stg)

Pass or fail!
ElMaestro

Complete thread:

UA Flag
Activity
 Admin contact
23,424 posts in 4,927 threads, 1,672 registered users;
46 visitors (0 registered, 46 guests [including 12 identified bots]).
Forum time: 16:30 CEST (Europe/Vienna)

Reach for the stars,
even if you have to stand on a cactus.    Susan Longacre

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