Factorial Within Subjects Psy 420 Ainsworth Factorial WS Designs Analysis Factorial – deviation and computational Power, relative efficiency and sample size Effect size Missing data Specific Comparisons Example for Deviation Approach b2: Mystery b1: Science Fiction a1: Month 1 a2: Month 2 a3: Month 3 a1: Month 1 a2: Month 2 a3: Month 3 Case Means S1 S2 S3 S4 1 1 3 5 3 4 3 5 6 8 6 7 5 8 4 3 4 8 5 2 1 4 3 0 S1 = 3.333 S2 = 5.500 S3 = 4.000 S4 = 3.667 S5 2 4 5 5 6 3 S5 = 4.167 a2b1 = 3.8 a3b1 = 6.4 a1b2 = 5 a2b2 = 5 Treatment a1b1 = 2.4 Means a3b2 = 2.2 GM = 4.133 Analysis – Deviation What effects do we have? A B AB S AS BS ABS T Analysis – Deviation DFs DFA = a – 1 DFB = b – 1 DFAB = (a – 1)(b – 1) DFS = (s – 1) DFAS = (a – 1)(s – 1) DFBS = (b – 1)(s – 1) DFABS = (a – 1)(b – 1)(s – 1) DFT = abs - 1 Sums of Squares - Deviation The total variability can be partitioned into A, B, AB, Subjects and a Separate Error Variability for Each Effect SSTotal SS A SS B SS AB SS S SS AS SS BS SS ABS Y Y n Y Y n Y Y n Y Y n Y Y n Y Y 2 ijk 2 ... j . j. 2 ... k 2 jk . jk ... ..k ... 2 j . j. ... 2 k ..k ... 2 2 jk Yi.. Y... k Yij . Y. j . jk Yi.. Y... 2 2 j Yi.k Y. j. jk Yi.. Y... 2 2 2 2 2 Yijk Y. jk jk Yi.. Y... k Yij . Y. j . j Yi.k Y. j . Analysis – Deviation Before we can calculate the sums of squares we need to rearrange the data When analyzing the effects of A (Month) you need to AVERAGE over the effects of B (Novel) and vice versa The data in its original form is only useful for calculating the AB and ABS interactions For the A and AS effects Remake data, averaging over B a1: Month 1 a2: Month 2 a3: Month 3 Case Means 3 4.5 3.5 6 3.5 6 S1 = 3.333 S2 = 5.500 S4 3.5 4 4 3.5 4.5 3.5 S3 = 4.000 S4 = 3.667 S5 3.5 5 4 S5 = 4.167 Treatment Means a1 = 3.7 a2 = 4.4 a3 = 4.3 GM = 4.133 S1 S2 S3 SS A n j Y. j . Y... 10*[ 3.7 4.133 4.4 4.133 4.3 4.133 ] 2.867 2 2 2 2 SS S jk Yi.. Y... (3*2)*[ 3.333 4.133 5.5 4.133 4 4.133 2 2 2 2 3.667 4.133 4.167 4.133 16.467 2 2 SS AS k Yij . Y. j . jk Yi.. Y... 2 2 k Yij . Y. j . 2*[ 3 3.7 4.5 3.7 3.5 3.7 4 3.7 3.5 3.7 2 2 2 2 2 3.5 4.4 6 4.4 4 4.4 3.5 4.4 5 4.4 2 2 2 2 2 3.5 4.3 6 4.3 4.5 4.3 3.5 4.3 4 4.3 ] 20.6 2 2 SS AS 20.6 16.467 4.133 2 2 2 2 For B and BS effects Remake data, averaging over A b1: Science b2: Mystery Case Means Fiction S4 3.333 4.333 4.000 5.667 3.333 6.667 4.000 1.667 S1 = 3.333 S2 = 5.500 S3 = 4.000 S4 = 3.667 S5 3.667 4.667 S5 = 4.167 Treatment Means b1 = 4.200 b2 = 4.067 GM = 4.133 S1 S2 S3 SS B nk Y..k Y... 15*[ 4.2 4.133 4.067 4.133 ] .133 2 2 2 SS BS j Yi.k Y..k jk Yi.. Y... 2 2 j Yi.k Y..k 3*[ 3.333 4.2 4.333 4.2 4 4.2 2 2 2 2 5.667 4.2 3.667 4.2 3.333 4.067 6.667 4.067 2 2 2 2 4 4.067 1.667 4.067 4.667 4.067 ] 50 2 2 SS S jk Yi.. Y... 16.467 2 SS BS 50 16.467 33.533 2 For AB and ABS effects Use the data in its original form b2: Mystery b1: Science Fiction a1: Month 1 a2: Month 2 a3: Month 3 a1: Month 1 a2: Month 2 a3: Month 3 Case Means S1 S2 1 1 3 4 6 8 5 8 4 8 1 4 S1 = 3.333 S2 = 5.500 S3 S4 3 5 3 5 6 7 4 3 5 2 3 0 S3 = 4.000 S4 = 3.667 S5 2 4 5 5 6 3 S5 = 4.167 a2b1 = 3.8 a3b1 = 6.4 a1b2 = 5 a2b2 = 5 Treatment a1b1 = 2.4 Means a3b2 = 2.2 GM = 4.133 SS AB n jk Y. jk Y... n j Y. j . Y... nk Y..k Y... 2 n Y jk 2 Y... 5*[ 2.4 4.133 3.8 4.133 6.4 4.133 2 . jk 2 2 2 5 4.133 5 4.133 2.2 4.133 ] 67.467 2 2 n Y Y... SS A 2.867 n Y Y... SS B .133 j k . j. ..k 2 2 SS AB 67.467 2.867 .133 64.467 2 2 2 2 2 2 SS ABS Yijk Y. jk jk Yi .. Y... k Yij . Y. j . j Yi.k Y. j . Yijk Y. jk 1 2.4 1 2.4 3 2.4 2 2 2 2 5 2.4 2 2.4 3 3.8 4 3.8 2 2 2 2 3 3.8 5 3.8 4 3.8 6 6.4 2 2 2 2 8 6.4 6 6.4 7 6.4 5 6.4 2 2 2 2 6 5 8 5 4 5 3 5 2 2 2 2 5 5 4 5 8 5 5 5 2 2 2 2 2 5 6 5 1 2.2 4 2.2 2 2 2 2 3 2.2 0 2.2 3 2.2 64 2 2 2 SS ABS 64 16.467 20.6 50 9.867 SSTotal 1 4.133 1 4.133 3 4.133 2 2 2 5 4.133 2 4.133 3 4.133 4 4.133 2 2 2 2 3 4.133 5 4.133 4 4.133 6 4.133 2 2 2 2 8 4.133 6 4.133 7 4.133 5 4.133 2 2 2 2 6 4.133 8 4.133 4 4.133 3 4.133 2 2 2 2 5 4.133 4 4.133 8 4.133 5 4.133 2 2 2 2 2 4.133 6 4.133 1 4.133 4 4.133 2 2 2 3 4.133 0 4.133 3 4.133 131.467 2 2 2 2 Analysis – Deviation DFs DFA = a – 1 = 3 – 1 = 2 DFB = b – 1 = 2 – 1 = 1 DFAB = (a – 1)(b – 1) = 2 * 1 = 2 DFS = (s – 1) = 5 – 1 = 4 DFAS = (a – 1)(s – 1) = 2 * 4 = 8 DFBS = (b – 1)(s – 1) = 1 * 4 = 4 DFABS = (a – 1)(b – 1)(s – 1) = 2 * 1 * 4 = 8 DFT = abs – 1 = [3*(2)*(5)] – 1 = 30 – 1 = 29 Source Table - Deviation Source A AS B BS AB ABS S Total SS 2.867 4.133 0.133 33.533 64.467 9.867 16.467 131.467 df 2 8 1 4 2 8 4 29 MS 1.433 0.517 0.133 8.383 32.233 1.233 4.117 F 2.774 0.016 26.135 Analysis – Computational Example data re-calculated with totals b1: Science Fiction b2: Mystery Case a1: Month 1 a2: Month 2 a3: Month 3 a1: Month 1 a2: Month 2 a3: Month 3 Totals S1 1 3 6 5 4 1 S1=20 S2 1 4 8 8 8 4 S2=33 S3 3 3 6 4 5 3 S3=24 S4 5 5 7 3 2 0 S4=22 S5 Treatment Totals 2 4 5 5 6 3 S5=25 a1b1 = 12 a2b1 = 19 a3b1 = 32 a1b2 = 25 a2b2 = 25 a3b2 = 11 T = 124 Analysis – Computational Before we can calculate the sums of squares we need to rearrange the data When analyzing the effects of A (Month) you need to SUM over the effects of B (Novel) and vice versa The data in its original form is only useful for calculating the AB and ABS interactions Analysis – Computational For the Effect of A (Month) and A x S Month Case a1: Month 1 a2: Month 2 a3: Month 3 Totals S1 6 7 7 S1=20 S2 9 12 12 S2=33 S3 7 8 9 S3=24 S4 8 7 7 S4=22 S5 Treatment Totals 7 10 8 S5=25 37 44 43 T = 124 a 2 T 2 37 2 442 432 1242 SS A bs abs 2(5) 2(3)(5) 5154 15376 SS A 515.4 512.533 2.867 10 30 j SS S si 2 T 2 202 332 242 222 252 512.533 abs 2(3) ab 3174 SS S 512.533 529 512.533 16.467 6 a j si 2 a j 2 si 2 T2 SS AS b bs ab abs 62 92 7 2 82 7 2 7 2 122 82 7 2 102 7 2 12 2 9 2 7 2 82 SS AS 2 1072 515.4 529 512.533 515.4 529 512.533 2 SS AS 536 515.4 529 512.533 4.133 Analysis – Traditional For B (Novel) and B x S Type of Novel b1: Science Fiction b2: Mystery Case Totals S1 10 10 S1=20 S2 13 20 S2=33 S3 12 12 S3=24 S4 17 5 S4=22 S5 Treatment Totals 11 14 S5=25 63 61 T = 124 SS B b 2 k as T 2 632 612 512.533 abs 3(5) 7690 SS B 512.533 512.667 512.533 .133 15 b s b s 2 2 2 T2 SS BS a as ab abs 102 132 122 17 2 112 102 202 122 52 142 SS BS 3 512.667 529 512.533 1688 SS BS 512.667 529 512.533 3 SS BS 562.667 512.667 529 512.533 33.533 k i k i Analysis – Computational Example data re-calculated with totals b1: Science Fiction b2: Mystery Case a1: Month 1 a2: Month 2 a3: Month 3 a1: Month 1 a2: Month 2 a3: Month 3 Totals S1 1 3 6 5 4 1 S1=20 S2 1 4 8 8 8 4 S2=33 S3 3 3 6 4 5 3 S3=24 S4 5 5 7 3 2 0 S4=22 S5 Treatment Totals 2 4 5 5 6 3 S5=25 a1b1 = 12 a2b1 = 19 a3b1 = 32 a1b2 = 25 a2b2 = 25 a3b2 = 11 T = 124 a b a b 2 SS AB SS AB SS AB SS AB j k j k 2 T2 abs s bs as 122 192 322 252 252 112 515.4 512.667 512.533 5 2900 515.4 512.667 512.533 5 580 515.4 512.667 512.533 64.467 SS ABS Y 2 2 a j SS ABS SSTotal 2 a j bk s 2 a j si b b s 2 2 2 bk si a 2 T2 bs as ab abs 644 580 536 562.667 515.4 512.667 529 512.533 9.867 k i T2 Y 644 512.533 131.467 abs 2 Analysis – Computational DFs are the same DFs DFA = a – 1 = 3 – 1 = 2 DFB = b – 1 = 2 – 1 = 1 DFAB = (a – 1)(b – 1) = 2 * 1 = 2 DFS = (s – 1) = 5 – 1 = 4 DFAS = (a – 1)(s – 1) = 2 * 4 = 8 DFBS = (b – 1)(s – 1) = 1 * 4 = 4 DFABS = (a – 1)(b – 1)(s – 1) = 2 * 1 * 4 = 8 DFT = abs – 1 = [3*(2)*(5)] – 1 = 30 – 1 = 29 Source Table – Computational Is also the same Source A AS B BS AB ABS S Total SS 2.867 4.133 0.133 33.533 64.467 9.867 16.467 131.467 df 2 8 1 4 2 8 4 29 MS 1.433 0.517 0.133 8.383 32.233 1.233 4.117 F 2.774 0.016 26.135 Relative Efficiency One way of conceptualizing the power of a within subjects design is to calculate how efficient (uses less subjects) the design is compared to a between subjects design One way of increasing power is to minimize error, which is what WS designs do, compared to BG designs WS designs are more powerful, require less subjects, therefore are more efficient Relative Efficiency Efficiency is not an absolute value in terms of how it’s calculated In short, efficiency is a measure of how much smaller the WS error term is compared to the BG error term Remember that in a one-way WS design: SSAS=SSS/A - SSS Relative Efficiency MSS / A df AS 1 df S / A 3 Relative Efficiency = MS AS df AS 3 df S / A 1 MSS/A can be found by either re-running the analysis as a BG design or for one-way: SSS + SSAS = SSS/A and dfS + dfAS = dfS/A MSS / A s 1 MSS a 1 s 1 MS AS as 1 Relative Efficiency From our one-way example: Source A S AxS Total SS 41.20 9.70 9.50 60.40 df 2 4 8 14 MS 20.60 2.43 1.19 F 17.35 2.04 SS S / A SS S SS AS 9.7 9.5 19.2 df S / A df S df AS 4 8 12 MS S / A 19.2 /12 1.6 Relative Efficiency 1.6 8 1 12 3 Relative Efficiency = 1.26 1.2 8 3 12 1 From the example, the within subjects design is roughly 26% more efficient than a between subjects design (controlling for degrees of freedom) For # of BG subjects (n) to match WS (s) efficiency: n s(relative efficiency) 5(1.26) 6.3 7 Power and Sample Size Estimating sample size is the same from before For a one-way within subjects you have and AS interaction but you only estimate sample size based on the main effect For factorial designs you need to estimate sample size based on each effect and use the largest estimate Realize that if it (PC-Size, formula) estimates 5 subjects, that total, not per cell as with BG designs Effects Size Because of the risk of a true AS interaction we need to estimate lower and upper bound estimates SS A SS A SSTotal SS A SS S SS AS 2 2 L SS A SS A partial SS A SSerror SS A SS AS 2 df A ( MS A MS AS ) ˆ df A ( MS A MS AS ) as ( MS AS ) s ( MS S ) 2 L partial ˆ 2 df A ( MS A MS AS ) df A ( MS A MS AS ) as ( MS AS ) Missing Values In repeated measures designs it is often the case that the subjects may not have scores at all levels (e.g. inadmissible score, dropout, etc.) The default in most programs is to delete the case if it doesn’t have complete scores at all levels If you have a lot of data that’s fine If you only have a limited cases… Missing Values Estimating values for missing cases in WS designs (one method: takes mean of Aj, mean for the case and the grand mean) Yij* sSi' aA'j T ' (a 1)( s 1) where : Yij* predicted score to replace missing score s number of cases Si' sum of known values for that case a number of levels of A A'j sum of known values for A T ' sum of all known values Specific Comparisons F-tests for comparisons are exactly the same as for BG n( w jY j ) / w 2 F 2 j MSerror Except that MSerror is not just MSAS, it is going to be different for every comparison It is recommended to just calculate this through SPSS