Replicated Latin Square and Crossover Designs

Similar documents
Latin Square Design. Design of Experiments - Montgomery Section 4-2

GLM Example: One-Way Analysis of Covariance

Statistical Consulting Topics. RCBD with a covariate

Problem Points Score USE YOUR TIME WISELY USE CLOSEST DF AVAILABLE IN TABLE SHOW YOUR WORK TO RECEIVE PARTIAL CREDIT

RANDOMIZED COMPLETE BLOCK DESIGN (RCBD) Probably the most used and useful of the experimental designs.

Block Block Block

RCBD with Sampling Pooling Experimental and Sampling Error

PROC GLM AND PROC MIXED CODES FOR TREND ANALYSES FOR ROW-COLUMN DESIGNED EXPERIMENTS

Subject-specific observed profiles of change from baseline vs week trt=10000u

Linear mixed models and when implied assumptions not appropriate

1'-tq/? BU-- _-M August 2000 Technical Report Series of the Department of Biometrics, Cornell University, Ithaca, New York 14853

Mixed Models Lecture Notes By Dr. Hanford page 151 More Statistics& SAS Tutorial at Type 3 Tests of Fixed Effects

Modelling Intervention Effects in Clustered Randomized Pretest/Posttest Studies. Ed Stanek

Mixed Effects Models Yan Wang, Bristol-Myers Squibb, Wallingford, CT

Paired plot designs experience and recommendations for in field product evaluation at Syngenta

Do delay tactics affect silking date and yield of maize inbreds? Stephen Zimmerman Creative Component November 2015

Moving on from MSTAT. March The University of Reading Statistical Services Centre Biometrics Advisory and Support Service to DFID

Model II ANOVA: Variance Components

Supplementary Figures Supplementary Figure 1 Comparison of among-replicate variance in invasion dynamics

Mixed models in R using the lme4 package Part 2: Longitudinal data, modeling interactions

Chapter 27. Inferences for Regression. Remembering Regression. An Example: Body Fat and Waist Size. Remembering Regression (cont.)

More About Regression

COMP Test on Psychology 320 Check on Mastery of Prerequisites

Bootstrap Methods in Regression Questions Have you had a chance to try any of this? Any of the review questions?

Resampling Statistics. Conventional Statistics. Resampling Statistics

8 Nonparametric test. Question 1: Are (expected) value of x and y the same?

DV: Liking Cartoon Comedy

STAT 113: Statistics and Society Ellen Gundlach, Purdue University. (Chapters refer to Moore and Notz, Statistics: Concepts and Controversies, 8e)

I. Model. Q29a. I love the options at my fingertips today, watching videos on my phone, texting, and streaming films. Main Effect X1: Gender

WPA REGIONAL CONGRESS OSAKA Japan 2015

MID-TERM EXAMINATION IN DATA MODELS AND DECISION MAKING 22:960:575

TWO-FACTOR ANOVA Kim Neuendorf 4/9/18 COM 631/731 I. MODEL

Exercises. ASReml Tutorial: B4 Bivariate Analysis p. 55

in the Howard County Public School System and Rocketship Education

What is Statistics? 13.1 What is Statistics? Statistics

Algebra I Module 2 Lessons 1 19

A STATISTICAL VIEW ON THE EXPRESSIVE TIMING OF PIANO ROLLED CHORDS

Sociology 7704: Regression Models for Categorical Data Instructor: Natasha Sarkisian

MANOVA/MANCOVA Paul and Kaila

Master's thesis FACULTY OF SCIENCES Master of Statistics

Supplemental Material: Color Compatibility From Large Datasets

K-Pop Idol Industry Minhyung Lee

UPDATED STANDARDIZED CATCH RATES OF BLUEFIN TUNA (THUNNUS THYNNUS) FROM THE TRAP FISHERY IN TUNISIA

Department of Electrical & Electronic Engineering Imperial College of Science, Technology and Medicine. Project: Real-Time Speech Enhancement

How Consumers Content Preference Affects Cannibalization: An Empirical Analysis of an E-book Market

Normalization Methods for Two-Color Microarray Data

Predicting the Importance of Current Papers

GENOTYPE AND ENVIRONMENTAL DIFFERENCES IN FIBRE DIAMETER PROFILE CHARACTERISTICS AND THEIR RELATIONSHIP WITH STAPLE STRENGTH IN MERINO SHEEP

Comparison of Mixed-Effects Model, Pattern-Mixture Model, and Selection Model in Estimating Treatment Effect Using PRO Data in Clinical Trials

AskDrCallahan Calculus 1 Teacher s Guide

subplots (30-m by 33-m) without space between potential subplots. Depending on the size of the

Blueline, Linefree, Accuracy Ratio, & Moving Absolute Mean Ratio Charts

Reviews of earlier editions

Multiple-point simulation of multiple categories Part 1. Testing against multiple truncation of a Gaussian field

BER margin of COM 3dB

Reliability. What We Will Cover. What Is It? An estimate of the consistency of a test score.

TI-Inspire manual 1. Real old version. This version works well but is not as convenient entering letter

Open Access Determinants and the Effect on Article Performance

1.1 The Language of Mathematics Expressions versus Sentences

Visible Vibrations (originally Chladni Patterns) - Adding Memory Buttons. Joshua Gutwill. August 2002

Bite Size Brownies. Designed by: Jonathan Thompson George Mason University, COMPLETE Math

a user's guide to Probit Or LOgit analysis

Spillovers between property rights and transaction costs for innovative industries: Evidence from vertical integration in broadcast television

Common assumptions in color characterization of projectors

Relationships Between Quantitative Variables

%CHCKFRQS A Macro Application for Generating Frequencies for QC and Simple Reports

AP Statistics Sampling. Sampling Exercise (adapted from a document from the NCSSM Leadership Institute, July 2000).

NENS 230 Assignment #2 Data Import, Manipulation, and Basic Plotting

Electrospray-MS Charge Deconvolutions without Compromise an Enhanced Data Reconstruction Algorithm utilising Variable Peak Modelling

Chapter 5. Describing Distributions Numerically. Finding the Center: The Median. Spread: Home on the Range. Finding the Center: The Median (cont.

Analysis of Film Revenues: Saturated and Limited Films Megan Gold

Relationships. Between Quantitative Variables. Chapter 5. Copyright 2006 Brooks/Cole, a division of Thomson Learning, Inc.

PRECISION OF MEASUREMENT OF DIAMETER, AND DIAMETER-LENGTH PROFILE, OF GREASY WOOL STAPLES ON-FARM, USING THE OFDA2000 INSTRUMENT

ECE 555 DESIGN PROJECT Introduction and Phase 1

2. AN INTROSPECTION OF THE MORPHING PROCESS

Adaptive decoding of convolutional codes

Decision-Maker Preference Modeling in Interactive Multiobjective Optimization

SECTION I. THE MODEL. Discriminant Analysis Presentation~ REVISION Marcy Saxton and Jenn Stoneking DF1 DF2 DF3

FPGA IMPLEMENTATION AN ALGORITHM TO ESTIMATE THE PROXIMITY OF A MOVING TARGET

THE FAIR MARKET VALUE

Precision testing methods of Event Timer A032-ET

Variation in fibre diameter profile characteristics between wool staples in Merino sheep

System Identification

Best Pat-Tricks on Model Diagnostics What are they? Why use them? What good do they do?

UPDATE TO DOWNSTREAM FREQUENCY INTERLEAVING AND DE-INTERLEAVING FOR OFDM. Presenter: Rich Prodan

Least squares: intro to fitting a line to data

Example the number 21 has the following pairs of squares and numbers that produce this sum.

PART FOUR. Polyalphabetic Substitution Systems PERIODIC POLYALPHABETIC SUBSTITUTION SYSTEMS

Analysis of Packet Loss for Compressed Video: Does Burst-Length Matter?

Mixed Linear Models. Case studies on speech rate modulations in spontaneous speech. LSA Summer Institute 2009, UC Berkeley

10.4 Inference as Decision. The 1995 O.J. Simpson trial: the situation

Discriminant Analysis. DFs

1/ 19 2/17 3/23 4/23 5/18 Total/100. Please do not write in the spaces above.

Technical Appendices to: Is Having More Channels Really Better? A Model of Competition Among Commercial Television Broadcasters

INTEGRATED CIRCUITS. AN219 A metastability primer Nov 15

Detecting Medicaid Data Anomalies Using Data Mining Techniques Shenjun Zhu, Qiling Shi, Aran Canes, AdvanceMed Corporation, Nashville, TN

Perceptual Analysis of Video Impairments that Combine Blocky, Blurry, Noisy, and Ringing Synthetic Artifacts

Digital Correction for Multibit D/A Converters

CPSC 121: Models of Computation. Module 1: Propositional Logic

Deep Neural Networks Scanning for patterns (aka convolutional networks) Bhiksha Raj

Transcription:

Replicated Latin Square and Crossover Designs

Replicated Latin Square Latin Square Design small df E, low power If 3 treatments 2 df error If 4 treatments 6 df error Can use replication to increase df E, power Methods of replication Use the same row and column blocks Use new row blocks but same column blocks Use the same row blocks and new column blocks Use new row and column blocks Degrees of freedom depend on what is new /randomized Often include additional block - replicate effect Replicated Latin Squares 2

Replicate the Square Same row/column blocks used in additional squares Usually includes replicate (e.g., time) effect y ijkl = µ + α i + τ j + β k + δ l + ǫ ijkl i = 1, 2,..., p j = 1, 2,..., p k = 1, 2,..., p l = 1, 2,..., n Replicated Latin Squares 3

Source of Sum of Degrees of Mean F Variation Squares Freedom Square Rows SS Row p 1 Columns SS Column p 1 Replicate SS Replicate n 1 Treatment SS Treatment p 1 MS Treatment F 0 Error SS E (p 1)(n(p + 1) 3) MS E Total SS T np 2 1 Replicated Latin Squares 4

Replicate the Rows (or columns) Different rows (columns) in new square Row(column) effects nested within square Same column(row) effects y ijkl = µ + α i(l) + τ j + β k + δ l + ǫ ijkl i = 1, 2,..., p j = 1, 2,..., p k = 1, 2,..., p l = 1, 2,..., n Replicated Latin Squares 5

Source of Sum of Degrees of Mean F Variation Squares Freedom Square Rows SS Row n(p 1) Columns SS Column p 1 Replicate SS Replicate n 1 Treatment SS Treatment p 1 MS Treatment F 0 Error SS E (p 1)(np 2) MS E Total SS T np 2 1 Replicated Latin Squares 6

Latin Rectangle Replicate rows(columns) but not multiple squares np separate rows (n integer) y ijk = µ + α i + τ j + β k + ǫ ijk i = 1, 2,..., np j = 1, 2,..., p k = 1, 2,..., p Replicated Latin Squares 7

Source of Sum of Degrees of Mean F Variation Squares Freedom Square Rows SS Row np 1 Columns SS Column p 1 Treatment SS Treatment p 1 MS Treatment F 0 Error SS E (p 1)(np 2) MS E Total SS T np 2 1 Replicated Latin Squares 8

Replicated Rows and Columns Have completely separate squares Row and column effect nested within square y ijkl = µ + α i(l) + τ j + β k(l) + δ l + ǫ ijkl i = 1, 2,..., p j = 1, 2,..., p k = 1, 2,..., p l = 1, 2,..., n Replicated Latin Squares 9

Source of Sum of Degrees of Mean F Variation Squares Freedom Square Rows SS Row n(p 1) Columns SS Column n(p 1) Replicate SS Replicate n 1 Treatment SS Treatment p 1 MS Treatment F 0 Error SS E (p 1)(n(p 1) 1) MS E Total SS T np 2 1 Replicated Latin Squares 10

Graeco-Latin Square Design Described in Section 4.3 Superimposes two Latin Squares onto each other Allows blocking on three factors Exists for all p 3 except p 6 Degrees of freedom error is (p 3)(p 1) p = 4 df E =3 p = 5 df E =8 Replicated Latin Squares 11

Crossover Design A commonly-use within-subject design Considers s subjects as blocks Each subject undergoes p treatments run over p periods Can consider incomplete block structure (# periods < # trts) Used in drug comparisons/physiology experiments Delay between periods to remove residual effect Residual effect also called carryover effect Replicated Latin Squares 12

Crossover Design Used because one anticipates high level of variability between subjects block on subject to remove it Subject (S k ) is serving as its own control Commonly used for 2, 3, or 4 periods Period (P i ) is typically considered a blocking factor too Potential drawbacks: Subsequent use / carryover effect Replicated Latin Squares 13

Analysis of a Crossover Design Another variation of a repeated measures design Linear model approach similar to that of Latin Rectangle y ijk = µ + P i + τ j + S k + ǫ ijk Assumes no residual effects, subjects ǫ s can be correlated Consider 2 2 experiment with n subjects per group (order of treatments). Using model with ǫ N(0, sigma 2 ), the difference in trts for the two groups can be written Subjects who received Trt 1 first : diff 1k = (τ 1 τ 2 ) + (P 1 P 2 ) + (ǫ 11k ǫ 22k ) Subjects who received Trt 2 first : diff 2k = (τ 2 τ 1 ) + (P 1 P 2 ) + (ǫ 21k ǫ 12k ) Subject effects cancel out. Only within-subject variability left. Thus diff 1. diff 2. estimates 2(τ 1 τ 2 ) with standard error 4ˆσ 2 /n This result is equivalent to fitting the linear model above Replicated Latin Squares 14

Issue of Residual Effects But what if there are residual effects. This alters the overall effect in the second period. Considering r 1 and r 2 the residuals effects, the difference can be written Trt 1 first : diff 1k = (τ 1 (τ 2 + r 1 )) + (P 1 P 2 ) + (ǫ 11k ǫ 22k ) Trt 2 first : diff 2k = (τ 2 (τ 1 + r 2 )) + (P 1 P 2 ) + (ǫ 21k ǫ 12k ) Thus diff 1 diff 2 estimates 2(τ 1 τ 2 )+(r 2 r 1 ). Mean difference no longer estimates just difference in treatments (confounded with difference in residual effects). Can test for residual effect by looking at sums instead of differences. Consider subject effects random so subject variability incorporated into error (δ ijk = ǫ ijk +S k ) Trt 1 first : sum 1k = 2µ + (τ 1 + τ 2 + r 1 ) + (P 1 + P 2 ) + δ 1k Trt 2 first : sum 2k = 2µ + (τ 2 + τ 1 + r 2 ) + (P 1 + P 2 ) + δ 2k Thus sum 1 sum 2 estimates (r 1 r 2 ). Can check to see if different from zero. Unfortunately this is a low power test because it incorporates between-subject variability, which is often larger than within-subject variability. Replicated Latin Squares 15

Modeling Residual Effects Can attempt to include residual effects in model Need p > 2 if subjects considered fixed effect Not orthogonal so fit order important (Type III SS if using OLS) First-order residual effects model y ijk = µ + P i + τ j + S k + r ij + ǫ ijk i = 1, 2,..., p j = 1, 2,..., p k = 1, 2,..., np where r ij only occurs when i 1 and j references the trt used in the previous period. Replicated Latin Squares 16

Crossover Analysis when p = 2 Will analyze the following data set using Differences and sums Proc GLM - fixed effects linear model Proc Mixed - subjects considered random effects Need to create design column(s) for residual effects data trt2cross; input subj period trt resid y @@; cards; 1 1 1 0 32 1 2 2 1 35 2 1 1 0 31 2 2 2 1 36 3 1 1 0 31 3 2 2 1 35 4 1 1 0 33 4 2 2 1 37 5 1 1 0 32 5 2 2 1 35 6 1 2 0 35 6 2 1-1 33 7 1 2 0 36 7 2 1-1 30 8 1 2 0 34 8 2 1-1 32 9 1 2 0 38 9 2 1-1 35 10 1 2 0 37 10 2 1-1 37 ; Replicated Latin Squares 17

Demonstration Using SAS **Calculate differences and sums by hand and enter into data set; data trt2cross_diff; input subj order ydiff @@; cards; 1 1-3 2 1-5 3 1-4 4 1-4 5 1-3 6 2 2 7 2 6 8 2 2 9 2 3 10 2 0 ; proc ttest; var ydiff; class order; run; ***Test if trts differ data trt2cross_sum; input subj order ysum @@; cards; 1 1 67 2 1 67 3 1 66 4 1 70 5 1 67 6 2 68 7 2 66 8 2 66 9 2 73 10 2 74 ; proc ttest; var ysum; class order; run; ***Test if res effects differ Replicated Latin Squares 18

SAS Output Variable: ydiff order N Mean Std Dev Std Err Minimum Maximum 1 5-3.8000 0.8367 0.3742-5.0000-3.0000 2 5 2.6000 2.1909 0.9798 0 6.0000 Diff (1-2) -6.4000 1.6583 1.0488 Method Variances DF t Value Pr > t Pooled Equal 8-6.10 0.0003 ***Trt Satterthwaite Unequal 5.1424-6.10 0.0015 ------------------------------------------------------------------- Variable: ysum order N Mean Std Dev Std Err Minimum Maximum 1 5 67.4000 1.5166 0.6782 66.0000 70.0000 2 5 69.4000 3.8471 1.7205 66.0000 74.0000 Diff (1-2) -2.0000 2.9240 1.8493 Method Variances DF t Value Pr > t Pooled Equal 8-1.08 0.3110 ***Residual Satterthwaite Unequal 5.2139-1.08 0.3269 Replicated Latin Squares 19

Demonstration Using SAS ***Get trt*period means***; proc sort; by trt period; proc means; var y; by trt period; run; ***Fit using fixed effects linear model***; proc glm; class subj trt period; model y = subj trt period; lsmeans trt / lines; ***Try to include residual effects***; proc glm; class subj trt period; model y = resid period subj trt; lsmeans trt / lines; run; Replicated Latin Squares 20

SAS Output ***Summary of the Proc Means Output*** Trt1 Period1 31.8 Trt2 Period1 36.0 --> Trt1 32.6 Period1 33.9 Trt1 Period2 33.4 --> Trt2 35.8 Period2 34.5 Trt2 Period2 35.6 --> GrandMean 34.2 ***Using latin rectangle linear model**** Estimated treatment difference is 35.8-32.6 = 3.2 ***Using first-order residual effects model**** Period 1 Trt2 - Trt1 = 36.0-31.8 = 4.2 Period 2 Trt2 - Trt1 = 35.6-33.4 = 2.2 ** **Includes possible residuals effects **Therefore, estimated treatment difference is 4.2 **(r1 - r2) = 2*r1 = -2 --> r1 = -1 Replicated Latin Squares 21

GLM Output - No Residual Effects Sum of Source DF Squares Mean Square F Value Pr > F Model 11 92.2000000 8.3818182 6.10 0.0082 Error 8 11.0000000 1.3750000 Corrected Total 19 103.2000000 Source DF Type I SS Mean Square F Value Pr > F subj 9 39.20000000 4.35555556 3.17 0.0595 trt 1 51.20000000 51.20000000 37.24 0.0003*** period 1 1.80000000 1.80000000 1.31 0.2856 Source DF Type III SS Mean Square F Value Pr > F subj 9 39.20000000 4.35555556 3.17 0.0595 trt 1 51.20000000 51.20000000 37.24 0.0003*** period 1 1.80000000 1.80000000 1.31 0.2856 Parameter Estimate Std Error t Value Pr > t trt 1-3.20000000 B 0.52440442-6.10 0.0003*** period 1-0.60000000 B 0.52440442-1.14 0.2856 Replicated Latin Squares 22

GLM Output - Residual Effects Sum of Source DF Squares Mean Square F Value Pr > F Model 11 92.2000000 8.3818182 6.10 0.0082 Error 8 11.0000000 1.3750000 Corrected Total 19 103.2000000 Source DF Type I SS Mean Square F Value Pr > F resid 1 12.10000000 12.10000000 8.80 0.0180 period 1 1.80000000 1.80000000 1.31 0.2856 subj 9 78.30000000 8.70000000 6.33 0.0081 trt 0 0.00000000... Source DF Type III SS Mean Square F Value Pr > F resid 0 0.00000000... period 1 1.80000000 1.80000000 1.31 0.2856 subj 8 34.20000000 4.27500000 3.11 0.0646 trt 0 0.00000000... *************CONFOUNDING OF EFFECTS PRESENT********************; Replicated Latin Squares 23

Demonstration Using SAS proc mixed; class subj trt period; model y = period trt / s ddfm=kr; random subj; lsmeans trt; run; proc mixed; class subj trt period; model y = resid period trt / s ddfm=kr; ***With residual effect; random subj; lsmeans trt; Replicated Latin Squares 24

Mixed Output - No Residual Effects Cov Parm Estimate subj 1.4903 Residual 1.3750 Solution for Fixed Effects Effect Estimate Std Error DF t Value Pr > t Intercept 36.1000 0.5961 16.5 60.57 <.0001 period -0.6000 0.5244 8-1.14 0.2856 trt -3.2000 0.5244 8-6.10 0.0003 *** Type 3 Tests of Fixed Effects Effect DF DF F Value Pr > F period 1 8 1.31 0.2856 trt 1 8 37.24 0.0003 *** Least Squares Means Effect trt Estimate Std Error DF t Value Pr > t trt 1 32.6000 0.5353 8 60.90 <.0001 trt 2 35.8000 0.5353 8 66.88 <.0001 Replicated Latin Squares 25

Mixed Output - Residual Effects Cov Parm Estimate subj 1.4500 Residual 1.3750 Solution for Fixed Effects Effect Estimate Std Error DF t Value Pr > t Intercept 36.6000 0.7517 12.7 48.69 <.0001 resid -1.0000 0.9247 8-1.08 0.3110 *** period -0.6000 0.5244 8-1.14 0.2856 trt -4.2000 1.0630 12.7-3.95 0.0017 Least Squares Means Effect trt Estimate Std Error DF t Value Pr > t trt 1 32.1000 0.7045 10.5 45.57 <.0001 trt 2 36.3000 0.7045 10.5 51.53 <.0001 Replicated Latin Squares 26

SAS Code - p = 4 data new; input cow period trt resp @@; if period=1 then resid=0; else resid=a; resid1=0; resid2=0; resid3=0; if resid=1 then resid1=1; if resid=4 then resid1=-1; if resid=2 then resid2=1; if resid=4 then resid2=-1; if resid=3 then resid3=1; if resid=4 then resid3=-1; a=trt; retain a; cards; 1 1 1 38 1 2 2 32 1 3 3 35 1 4 4 33 2 1 2 39 2 2 3 37 2 3 4 36 2 4 1 30 3 1 3 45 3 2 4 38 3 3 1 37 3 4 2 35 4 1 4 41 4 2 1 30 4 3 2 32 4 4 3 33 ; proc print; run; Replicated Latin Squares 27

SAS Code proc glm; class cow period trt; model resp=cow period trt resid1 resid2 resid3 / solution; lsmeans trt / stderr pdiff cl lines; Obs cow period trt resp resid resid1 resid2 resid3 1 1 1 1 38 0 0 0 0 2 1 2 2 32 1 1 0 0 3 1 3 3 35 2 0 1 0 4 1 4 4 33 3 0 0 1 5 2 1 2 39 0 0 0 0 6 2 2 3 37 2 0 1 0 7 2 3 4 36 3 0 0 1 8 2 4 1 30 4-1 -1-1......... 16 4 4 3 33 2 0 1 0 Replicated Latin Squares 28

SAS Output Sum of Source DF Squares Mean Square F Value Pr > F Model 12 244.6875000 20.3906250 22.24 0.0133 Error 3 2.7500000 0.9166667 Corrected Total 15 247.4375000 Source DF Type I SS Mean Square F Value Pr > F cow 3 54.6875000 18.2291667 19.89 0.0175 period 3 147.1875000 49.0625000 53.52 0.0042 trt 3 40.6875000 13.5625000 14.80 0.0265 resid1 1 0.5625000 0.5625000 0.61 0.4906 *** Sum these resid2 1 0.5208333 0.5208333 0.57 0.5057 *** together to resid3 1 1.0416667 1.0416667 1.14 0.3646 *** get SS(resid) Source DF Type III SS Mean Square F Value Pr > F cow 3 46.0833333 15.3611111 16.76 0.0223 period 3 147.1875000 49.0625000 53.52 0.0042 trt 3 7.8409091 2.6136364 2.85 0.2062 *** Want to look at resid1 1 0.3750000 0.3750000 0.41 0.5679 trt after adjusting resid2 1 1.0416667 1.0416667 1.14 0.3646 for all else resid3 1 1.0416667 1.0416667 1.14 0.3646 Tests of importance based off of SAS results above Source DF Type III SS Mean Square F Value Pr > F trt 3 7.8409091 2.6136364 2.85 0.2062 resid 3 2.1250000 0.7083333 0.77 0.5814 Replicated Latin Squares 29

Standard Parameter Estimate Error t Value Pr > t Intercept 33.00000000 B 0.95742711 34.47 <.0001 cow 1 0.62500000 B 0.82915620 0.75 0.5057 cow 2 2.00000000 B 0.82915620 2.41 0.0948 cow 3 5.37500000 B 0.82915620 6.48 0.0075 cow 4 0.00000000 B... period 1 8.00000000 B 0.67700320 11.82 0.0013 period 2 1.50000000 B 0.67700320 2.22 0.1135 period 3 2.25000000 B 0.67700320 3.32 0.0449 period 4 0.00000000 B... trt 1-3.62500000 B 1.58771324-2.28 0.1066 trt 2-4.00000000 B 1.58771324-2.52 0.0862 trt 3-1.37500000 B 1.58771324-0.87 0.4502 trt 4 0.00000000 B... resid1 0.75000000 1.17260394 0.64 0.5679 resid2 1.25000000 1.17260394 1.07 0.3646 resid3-1.25000000 1.17260394-1.07 0.3646 Residual Effect of A increases response 0.75 units Residual Effect of B increases response 1.25 units Residual Effect of C decreases response 1.25 units Residual Effect of D decreases response 0.75 units LSMEAN trt 1 = 35.6875 + (-3.625 -.25(-3.625-4.000-1.375)) = 34.3125 = intercept + trt effect LSMEAN trt 2 = 35.6875 + (-4.000 -.25(-3.625-4.000-1.375)) = 33.9375 = intercept + trt effect Replicated Latin Squares 30

Least Squares Means Standard LSMEAN trt resp LSMEAN Error Pr > t Number 1 34.3125000 1.0013012 <.0001 1 2 33.9375000 1.0013012 <.0001 2 3 36.5625000 1.0013012 <.0001 3 4 37.9375000 1.0013012 <.0001 4 resp LSMEAN LSMEAN trt Number A 37.9375 4 4 A A 36.5625 3 3 A A 34.3125 1 1 A A 33.9375 2 2 Least Squares Means for Effect trt Difference Between 95% Confidence Limits for i j Means LSMean(i)-LSMean(j) 1 2 0.375000-4.677812 5.427812 1 3-2.250000-7.302812 2.802812 1 4-3.625000-8.677812 1.427812 2 3-2.625000-7.677812 2.427812 2 4-4.000000-9.052812 1.052812 3 4-1.375000-6.427812 3.677812 Replicated Latin Squares 31

SAS Code ***Provides same results as Proc GLM output; proc mixed; class cow period trt; model resp=period trt cow resid1 resid2 resid3 / solution; lsmeans trt / cl; contrast resid eff resid1 1, resid2 1, resid3 1; run; ***Slightly different because cows random effects; proc mixed; class cow period trt; model resp=period trt resid1 resid2 resid3 / solution; random cow; lsmeans trt / cl; contrast resid eff resid1 1, resid2 1, resid3 1; run; Replicated Latin Squares 32

Designs Balanced For Residual Effects Consider the following two Latin squares Suppose row=period and column=subject D C B A C D A B B A D C A B C D D C B A C A D B B D A C A B C D (Left) C D twice, A D once, B D never (Right) Each trt follows each other trt once Right square balanced for residual effects If p even, can be balanced using p subjects If p odd, need multiple of 2p subjects Replicated Latin Squares 33

Alternative Notation Consider a 2 2 crossover design with n subjects Subject n-1 Order 1 Period 1 Subject(order) n-2 Trt 1 Trt 1 Error n-2 Trt*Order 1 Error n-2 Period confounded with Trt*Order When subjects are random, don t expect Order differences so when significant, suggests there may be carryover effects. In fact, this is the same test as the difference in sums or including a residual effect. Replicated Latin Squares 34

Advantages Benefits and Drawbacks Subjects serve as their own control to reduce error May be able to get more volunteers if subjects particular to a treatment Drawbacks Subjects must be available for longer periods of time Carryover issue...are subjects the same at the start of each period? Crossover design avoided in comparative clinical studies Replicated Latin Squares 35