Potvin – all effects fixed (PHX/WNL vs. SAS, R) [Two-Stage / GS Designs]
Hi Helmut,
check your coding, I thik there's an issue with seq.
I get:
We have a winner?
PS: With that coding for subject we will of course not talk about subject nested in sequence or stage

. 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:
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



M=lm(log(PK)~0+Trt+Stg+Seq+Subj+Per%in%Stg)
—
Pass or fail!
ElMaestro
Pass or fail!
ElMaestro
Complete thread:
- Potvin – all effects fixed (PHX/WNL vs. SAS, R) Helmut 2012-10-26 19:35 [Two-Stage / GS Designs]
- Potvin – all effects fixed (PHX/WNL vs. SAS, R) ElMaestro 2012-10-26 20:14
- Potvin – all effects fixed (PHX/WNL vs. SAS, R) Helmut 2012-10-26 20:25
- Potvin – all effects fixed (PHX/WNL vs. SAS, R)ElMaestro 2012-10-26 22:05
- Potvin – all effects fixed (PHX/WNL vs. SAS, R) Helmut 2012-10-26 20:25
- Potvin – all effects fixed - SAS d_labes 2012-10-29 09:57
- Potvin – all effects fixed (PHX/WNL resolved) Helmut 2012-11-06 01:43
- Potvin – all effects fixed (PHX/WNL resolved) ElMaestro 2012-11-06 11:48
- Potvin – all effects fixed (PHX/WNL resolved) Helmut 2012-11-06 13:48
- Mysterious ways ElMaestro 2012-11-06 15:27
- Mysterious ways Helmut 2012-11-06 17:06
- Mysterious ways ElMaestro 2012-11-06 15:27
- Potvin – all effects fixed (PHX/WNL resolved) Helmut 2012-11-06 13:48
- Potvin – all effects fixed (PHX/WNL resolved) ElMaestro 2012-11-06 11:48
- Potvin – all effects fixed (PHX/WNL resolved) Helmut 2012-11-06 01:43
- Potvin – all effects fixed (PHX/WNL vs. SAS, R) ElMaestro 2012-10-26 20:14