3rd, 4th opinion [RSABE / ABEL]
Dear John!
I have checked your results with a different coding approach avoiding all the bells and whistles with separating the values for Test and Ref., coding sequences numeric and getting the replicates by such monsters like
which depend naturally on the sequence numbering and is error prone.
Here my code, taking your first posted data:
Output omitted. It is totally the same as your results
.
Fortunately the mse's (=2*s2wR) are the same in both evaluations.
You can obtain the results of the CRO if you uncomment the statement in red above. It seems that the use of the progesterone code without considering the different numbering of the sequences has lead to such a calculation.
By luck this contrast doesn't change the mse because nobody will challenge you defining R-R as R2-R1 instead of the usual R1-R2.
The ANOVA for T-R (ilat in the progesterone guidance speak) is left as your homework
. Also the various 'ODS output' statements to save the necessary terms for calculating the linearized scaled ABE criterion and its 95% CI.
BTW: 4th opinion: An R implementation using the same spirit as the SAS code above gives
I have checked your results with a different coding approach avoiding all the bells and whistles with separating the values for Test and Ref., coding sequences numeric and getting the replicates by such monsters like
...
if (seq=1 and per=3) or (seq=2 and per=3) or (seq=3 and per=2);
...
which depend naturally on the sequence numbering and is error prone.
Here my code, taking your first posted data:
Data John;
input subject period tmtAB $ seqABC $ logval;
datalines;
1 1 B B 7.423568444
1 2 A B 7.70210434
1 3 B B 6.964135612
...
;
run;
* recode. not really necessary but common notation;
data john;
set john;
if tmtAB='A' then tmt='T';
if tmtAB='B' then tmt='R';
if seqABC='A' then sequence='TRR';
if seqABC='B' then sequence='RTR';
if seqABC='C' then sequence='RRT';
if seqABC='A' then seq=1;
if seqABC='B' then seq=2;
if seqABC='C' then seq=3;
run;
* replicate no. this is the KEY step;
Proc sort data=john; by subject tmtAB period; run;
data john;
set john;
by subject tmtAB;
if first.tmtAB then repl=1;
else repl+1;
run;
data john;
set john;
tmtrepl=tmt||put(repl,1.);
run;
* make the wide form with columns T1 R1 R2;
Proc transpose data=john out=john_t;
by subject sequence seq;
var logval;
id tmtrepl;
run;
* intra-subject contrasts;
Data john_t;
set john_t;
* the only place to change in case of full replicate;
* use then TR=0.5*(T1+T2-R1-R2);
TR=T1-0.5*(R1+R2);
RR=R1-R2;
* uncomment next line to get the CRO results;
* if seq=2 then RR=-RR;
run;
* and now: trara-trara-tra-ra the ANOVA for R-R;
Title GLM analysis of R-R;
Proc GLM data=john_T;
class sequence;
model RR = sequence;
run; quit;
Output omitted. It is totally the same as your results

Fortunately the mse's (=2*s2wR) are the same in both evaluations.
You can obtain the results of the CRO if you uncomment the statement in red above. It seems that the use of the progesterone code without considering the different numbering of the sequences has lead to such a calculation.
By luck this contrast doesn't change the mse because nobody will challenge you defining R-R as R2-R1 instead of the usual R1-R2.
The ANOVA for T-R (ilat in the progesterone guidance speak) is left as your homework

BTW: 4th opinion: An R implementation using the same spirit as the SAS code above gives
Analysis of Variance Table
Response: RR
Df Sum Sq Mean Sq F value Pr(>F)
sequence 2 0.1797 0.08986 0.2771 0.7588
Residuals 66 21.4025 0.32428
—
Regards,
Detlew
Regards,
Detlew
Complete thread:
- SAS Procedure on Partial Replicate (TRR) Study Data jag009 2013-04-02 21:11 [RSABE / ABEL]
- Confusing… Helmut 2013-04-03 13:42
- Confusing… jag009 2013-04-03 16:06
- Confusing… Helmut 2013-04-03 21:49
- Confusing… jag009 2013-04-03 23:01
- Confusing… Helmut 2013-04-03 23:22
- Confusing… jag009 2013-04-04 15:59
- Confusing… jag009 2013-04-04 17:21
- 2nd opinion Helmut 2013-04-05 01:01
- 2nd opinion jag009 2013-04-05 15:24
- 3rd, 4th opiniond_labes 2013-04-05 11:04
- 3rd, 4th opinion jag009 2013-04-05 15:41
- Beer swaped d_labes 2013-04-05 16:09
- Beer swaped jag009 2013-04-05 17:18
- Beer swaped d_labes 2013-04-05 16:09
- 3rd, 4th opinion jag009 2013-04-05 15:41
- 2nd opinion Helmut 2013-04-05 01:01
- Confusing… Helmut 2013-04-03 23:22
- Confusing… jag009 2013-04-03 23:01
- Confusing… Helmut 2013-04-03 21:49
- Confusing… jag009 2013-04-03 16:06
- Confusing… Helmut 2013-04-03 13:42