230 likes | 350 Views
Design of Statistical Investigations. 7. Orthogonal Designs Two (plus) Blocking Factors. Stephen Senn. Exp_5 (Again). This experiments was run in two sequences Formoterol followed by salbutamol Salbutamol followed by formoterol
E N D
Design of Statistical Investigations 7. Orthogonal Designs Two (plus) Blocking Factors Stephen Senn SJS SDI_7
Exp_5 (Again) • This experiments was run in two sequences • Formoterol followed by salbutamol • Salbutamol followed by formoterol • Suppose that values in second period tend to be higher or lower than those in first • Differences formoterol -salbutamol will be affected one way or other depending on sequence SJS SDI_7
Exp_5A Further Factor • For each PEF reading we have accounted for • the patient it was measured under • the treatment the patient was on • We have not accounted for the period • We now look at an analysis that does SJS SDI_7
Exp_5Fitting period • #ANOVA fitting treat and patient • # Code factor for period • period<-factor(c(rep(1:2,n))) • #Perform ANOVA • fit3<-aov(pef~patient+period+treat) • summary(fit3) • multicomp(fit3,focus="treat",error.type="cwe",method="lsd") SJS SDI_7
Exp_5Comparison of 3 Models > summary(fit1) Df Sum of Sq Mean Sq F Value Pr(F) treat 1 13388.5 13388.46 2.56853 0.1220902 Residuals 24 125100.0 5212.50 > summary(fit2) Df Sum of Sq Mean Sq F Value Pr(F) patient 12 115213.5 9601.12 11.65357 0.000079348 treat 1 13388.5 13388.46 16.25053 0.001665618 Residuals 12 9886.5 823.88 > summary(fit3) Df Sum of Sq Mean Sq F Value Pr(F) patient 12 115213.5 9601.12 12.79457 0.0000890 period 1 984.6 984.62 1.31211 0.2763229 treat 1 14035.9 14035.92 18.70444 0.0012048 Residuals 11 8254.5 750.41 SJS SDI_7
Exp_5: Three Fits 95 % non-simultaneous confidence intervals for specified linear combinations, by the Fisher LSD method critical point: 2.0639 intervals excluding 0 are flagged by '****' Estimate Std.Error Lower Bound Upper Bound salbutamol-formoterol -45.4 28.3 -104 13.1 critical point: 2.1788 Estimate Std.Error Lower Bound Upper Bound salbutamol-formoterol -45.4 11.3 -69.9 -20.9 **** critical point: 2.201 Estimate Std.Error Lower Bound Upper Bound salbutamol-formoterol -46.6 10.8 -70.3 -22.9 **** SJS SDI_7
Why the Different Estimate? • Mean difference Salbutamol-Formoterol for 7 patients in seq 1 is -30.71 • Mean difference Formoterol-Salbutamol for 6 patients in seq 1 is -62.50 • The weighted average of these is -45.4 • The un-weighted average is -46.6 SJS SDI_7
Weighted • The weighted average weights the mean difference in a sequence by the number of patients • Thus the difference from each patient is weighted equally • This makes sense if there is no period effect. • Why make a distinction between sequences if this is the case? SJS SDI_7
Un-weighted • The un-weighted average weights means equally • Since there are more patients in the first sequence their individual influence is down-weighted. • This makes no sense unless we regard the results as not exchangeable by sequence • However, if there is a period effect then they are not exchangeable SJS SDI_7
How the Un-weighted Approach Adjust for Bias • Suppose there is a difference between period one and two and this difference is additive and equal to p. • Every patient will have their treatment difference affected by p. • Those in one sequence will have padded. • Those in other sequence will have p subtracted. • Averaged over the sequences this cancels out SJS SDI_7
How the Variances are Affected SJS SDI_7
The Effect of Modelling In general the variance of a treatment contrast may be expressed as the product of two factors: q and 2. For example, for the common two-sample t case q = (1/n1 + 1/n2) and 2 is the variance of the original observations within treatment groups. If further terms are added to the model the value of q will at best remain the same but in general will increase. If these terms are explanatory, however, they will reduce the value of 2 . SJS SDI_7
Variances in the Linear Model SJS SDI_7
Efficient Experimentation and Modelling • Two go hand in hand • Choose explanatory factors for model • Will reduce variance, 2. • Design experiment taking account of model • Minimise adverse effect on q. • Randomise • Subject to constraints above SJS SDI_7
Exp_5 and Efficiency • In this case there were 14 patients initially • Split 7 and 7 by sequence • But one (patient 8) dropped out • Hence the design is unbalanced • Note that balance is not the be all and end all • 7 and 6 is better than 6 and 6, although 6 and 6 is balanced SJS SDI_7
Efficiency in General • Balance in some sense produces efficiency • Equal numbers per treatment etc • Provided all contrasts are of equal interest • Treatments orthogonal to blocks • Construct treatment plan if possible so that this happens SJS SDI_7
Latin Squares • Suppose that we have two blocking factors each at r levels. • We also have r treatments and we wish to allocate these efficiently. • How should we do this? • One solution is to use a so-called Latin Square SJS SDI_7
More Than one Blocking Factor- Examples • Agricultural field trials • Rows and columns of a field • Cross-over trials • Patients and periods • Lab experiments • Technicians and days • Fuel efficiency • Drivers and cars SJS SDI_7
Latin Squares Examples SJS SDI_7
Latin Square5 x 5 Latin Square: 5 levels. BACD E A E BCD CBD E A DC E AB E DABC Produced by SYSTAT Each treatment given once to each row and once to each column Completely orthogonal No adverse effect on q SJS SDI_7
Design Matrices and Orthogonality • Such orthogonality in design is reflected in the “design matrices” used for coding for the linear model. • This is illustrated on the next few slides for the case of a 4 x 4 Latin square. • Four subjects are treated in four periods with four treatment. • The coding of the design matrix in Mathcad is illustrated. SJS SDI_7
Exp_7 • A four period cross-over in four subjects • The four sequences chosen form a Latin square. SJS SDI_7