Why does the S:x1 column disappear (presumably S:x1 goes into ID but I dont know why)? S is a factor, x1 is a covariate and ID is a factor. rich.side<-aov(y~S*x1+ID) summary(rich.side) Below is the model frame model.frame(~S*x1+ID) S x1 ID 1 1 12 A 2 1 12 A 3 1 12 A 4 1 12 A 5 1 0 B 6 1 0 B 7 1 0 B 8 1 0 B 9 1 0 C 10 1 0 C 11 1 0 C 12 1 0 C 13 1 0 D 14 1 0 D 15 1 0 D 16 1 0 D 17 1 0 E 18 1 0 E 19 1 0 E 20 1 0 E 21 1 0 F 22 1 0 F 23 1 0 F 24 1 0 F 25 2 6 AB 26 2 6 AB 27 2 6 AB 28 2 6 AB 29 2 6 AC 30 2 6 AC 31 2 6 AC 32 2 6 AC 33 2 6 AD 34 2 6 AD 35 2 6 AD 36 2 6 AD 37 2 6 AE 38 2 6 AE 39 2 6 AE 40 2 6 AE 41 2 6 AF 42 2 6 AF 43 2 6 AF 44 2 6 AF 45 2 0 BC 46 2 0 BC 47 2 0 BC 48 2 0 BC 49 2 0 BD 50 2 0 BD 51 2 0 BD 52 2 0 BD 53 2 0 BE 54 2 0 BE 55 2 0 BE 56 2 0 BE 57 2 0 BF 58 2 0 BF 59 2 0 BF 60 2 0 BF 61 2 0 CD 62 2 0 CD 63 2 0 CD 64 2 0 CD 65 2 0 CE 66 2 0 CE 67 2 0 CE 68 2 0 CE 69 2 0 CF 70 2 0 CF 71 2 0 CF 72 2 0 CF 73 2 0 DE 74 2 0 DE 75 2 0 DE 76 2 0 DE 77 2 0 DF 78 2 0 DF 79 2 0 DF 80 2 0 DF 81 2 0 EF 82 2 0 EF 83 2 0 EF 84 2 0 EF 85 3 4 ABC 86 3 4 ABC 87 3 4 ABC 88 3 4 ABC 89 3 4 ABD 90 3 4 ABD 91 3 4 ABD 92 3 4 ABD 93 3 4 ABE 94 3 4 ABE 95 3 4 ABE 96 3 4 ABE 97 3 4 ABF 98 3 4 ABF 99 3 4 ABF 100 3 4 ABF 101 3 4 ACD 102 3 4 ACD 103 3 4 ACD 104 3 4 ACD 105 3 4 ACE 106 3 4 ACE 107 3 4 ACE 108 3 4 ACE 109 3 4 ACF 110 3 4 ACF 111 3 4 ACF 112 3 4 ACF 113 3 4 ADE 114 3 4 ADE 115 3 4 ADE 116 3 4 ADE 117 3 4 ADF 118 3 4 ADF 119 3 4 ADF 120 3 4 ADF 121 3 4 AEF 122 3 4 AEF 123 3 4 AEF 124 3 4 AEF 125 3 0 BCD 126 3 0 BCD 127 3 0 BCD 128 3 0 BCD 129 3 0 BCE 130 3 0 BCE 131 3 0 BCE 132 3 0 BCE 133 3 0 BCF 134 3 0 BCF 135 3 0 BCF 136 3 0 BCF 137 3 0 BDE 138 3 0 BDE 139 3 0 BDE 140 3 0 BDE 141 3 0 BDF 142 3 0 BDF 143 3 0 BDF 144 3 0 BDF 145 3 0 BEF 146 3 0 BEF 147 3 0 BEF 148 3 0 BEF 149 3 0 CDE 150 3 0 CDE 151 3 0 CDE 152 3 0 CDE 153 3 0 CDF 154 3 0 CDF 155 3 0 CDF 156 3 0 CDF 157 3 0 CEF 158 3 0 CEF 159 3 0 CEF 160 3 0 CEF 161 3 0 DEF 162 3 0 DEF 163 3 0 DEF 164 3 0 DEF -- Yours sincerely, Justin *I check my email at 9AM and 4PM everyday* *If you have an EMERGENCY, contact me at +447938674419(UK) or +60125056192(Malaysia)* [[alternative HTML version deleted]]
Presumably it disappears because there is a unique value of ID for eac combination of S*x1 so they are indistinguishable. On 19/07/2016 12:53, Justin Thong wrote:> Why does the S:x1 column disappear (presumably S:x1 goes into ID but I dont > know why)? S is a factor, x1 is a covariate and ID is a factor. > > rich.side<-aov(y~S*x1+ID) > summary(rich.side) > > Below is the model frame > > model.frame(~S*x1+ID) > > S x1 ID > 1 1 12 A > 2 1 12 A > 3 1 12 A > 4 1 12 A > 5 1 0 B > 6 1 0 B > 7 1 0 B > 8 1 0 B > 9 1 0 C > 10 1 0 C > 11 1 0 C > 12 1 0 C > 13 1 0 D > 14 1 0 D > 15 1 0 D > 16 1 0 D > 17 1 0 E > 18 1 0 E > 19 1 0 E > 20 1 0 E > 21 1 0 F > 22 1 0 F > 23 1 0 F > 24 1 0 F > 25 2 6 AB > 26 2 6 AB > 27 2 6 AB > 28 2 6 AB > 29 2 6 AC > 30 2 6 AC > 31 2 6 AC > 32 2 6 AC > 33 2 6 AD > 34 2 6 AD > 35 2 6 AD > 36 2 6 AD > 37 2 6 AE > 38 2 6 AE > 39 2 6 AE > 40 2 6 AE > 41 2 6 AF > 42 2 6 AF > 43 2 6 AF > 44 2 6 AF > 45 2 0 BC > 46 2 0 BC > 47 2 0 BC > 48 2 0 BC > 49 2 0 BD > 50 2 0 BD > 51 2 0 BD > 52 2 0 BD > 53 2 0 BE > 54 2 0 BE > 55 2 0 BE > 56 2 0 BE > 57 2 0 BF > 58 2 0 BF > 59 2 0 BF > 60 2 0 BF > 61 2 0 CD > 62 2 0 CD > 63 2 0 CD > 64 2 0 CD > 65 2 0 CE > 66 2 0 CE > 67 2 0 CE > 68 2 0 CE > 69 2 0 CF > 70 2 0 CF > 71 2 0 CF > 72 2 0 CF > 73 2 0 DE > 74 2 0 DE > 75 2 0 DE > 76 2 0 DE > 77 2 0 DF > 78 2 0 DF > 79 2 0 DF > 80 2 0 DF > 81 2 0 EF > 82 2 0 EF > 83 2 0 EF > 84 2 0 EF > 85 3 4 ABC > 86 3 4 ABC > 87 3 4 ABC > 88 3 4 ABC > 89 3 4 ABD > 90 3 4 ABD > 91 3 4 ABD > 92 3 4 ABD > 93 3 4 ABE > 94 3 4 ABE > 95 3 4 ABE > 96 3 4 ABE > 97 3 4 ABF > 98 3 4 ABF > 99 3 4 ABF > 100 3 4 ABF > 101 3 4 ACD > 102 3 4 ACD > 103 3 4 ACD > 104 3 4 ACD > 105 3 4 ACE > 106 3 4 ACE > 107 3 4 ACE > 108 3 4 ACE > 109 3 4 ACF > 110 3 4 ACF > 111 3 4 ACF > 112 3 4 ACF > 113 3 4 ADE > 114 3 4 ADE > 115 3 4 ADE > 116 3 4 ADE > 117 3 4 ADF > 118 3 4 ADF > 119 3 4 ADF > 120 3 4 ADF > 121 3 4 AEF > 122 3 4 AEF > 123 3 4 AEF > 124 3 4 AEF > 125 3 0 BCD > 126 3 0 BCD > 127 3 0 BCD > 128 3 0 BCD > 129 3 0 BCE > 130 3 0 BCE > 131 3 0 BCE > 132 3 0 BCE > 133 3 0 BCF > 134 3 0 BCF > 135 3 0 BCF > 136 3 0 BCF > 137 3 0 BDE > 138 3 0 BDE > 139 3 0 BDE > 140 3 0 BDE > 141 3 0 BDF > 142 3 0 BDF > 143 3 0 BDF > 144 3 0 BDF > 145 3 0 BEF > 146 3 0 BEF > 147 3 0 BEF > 148 3 0 BEF > 149 3 0 CDE > 150 3 0 CDE > 151 3 0 CDE > 152 3 0 CDE > 153 3 0 CDF > 154 3 0 CDF > 155 3 0 CDF > 156 3 0 CDF > 157 3 0 CEF > 158 3 0 CEF > 159 3 0 CEF > 160 3 0 CEF > 161 3 0 DEF > 162 3 0 DEF > 163 3 0 DEF > 164 3 0 DEF >-- Michael http://www.dewey.myzen.co.uk/home.html
Hi Michael, Thank you for the reply. I am sorry I forgot to print out the anova table to make my question clear. Df Sum Sq Mean Sq F value Pr(>F) S 2 0.000019 9.630e-06 0.818 0.444 x1 1 0.000256 2.560e-04 21.751 9.44e-06 *** ID 47 0.003524 7.498e-05 6.370 3.35e-15 *** Resid 102 0.001201 1.177e-05 --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 There is *no* unique value for ID for each combination of S and x1. For example, S=1 and x1=0 can equal to either B or C or D or E or F . Perhaps you mean that for each combination of S and x1 have different values. If that is the case, I think maybe it makes sense. *What I think? * Anova has this thing where it fits the terms of 1st order first ( a formula term including no interactions) before it fits a 2nd order term ( a formula term including 1 interaction) and so on. First Order--> Second Order--> Third Order--> etc Therefore, it is known that the true fitting formula is not S+x1+S:x1+ID but it is S+x1+ID+S:x1. Hence, it appears that ID is fitted before S:x1 but since ID is a more refined factor than S:x1, it can be said that S:x1 is already included in the fit of ID so R recognizes the linear dependance and excludes the term S:x1. In other words, S:x1 is linearly dependant to ID. And so, the row S:x1 disappears because it is considered within ID. Does this makes sense? On 19 July 2016 at 16:19, Michael Dewey <lists at dewey.myzen.co.uk> wrote:> Presumably it disappears because there is a unique value of ID for eac > combination of S*x1 so they are indistinguishable. > > > On 19/07/2016 12:53, Justin Thong wrote: > >> Why does the S:x1 column disappear (presumably S:x1 goes into ID but I >> dont >> know why)? S is a factor, x1 is a covariate and ID is a factor. >> >> rich.side<-aov(y~S*x1+ID) >> summary(rich.side) >> >> Below is the model frame >> >> model.frame(~S*x1+ID) >> >> S x1 ID >> 1 1 12 A >> 2 1 12 A >> 3 1 12 A >> 4 1 12 A >> 5 1 0 B >> 6 1 0 B >> 7 1 0 B >> 8 1 0 B >> 9 1 0 C >> 10 1 0 C >> 11 1 0 C >> 12 1 0 C >> 13 1 0 D >> 14 1 0 D >> 15 1 0 D >> 16 1 0 D >> 17 1 0 E >> 18 1 0 E >> 19 1 0 E >> 20 1 0 E >> 21 1 0 F >> 22 1 0 F >> 23 1 0 F >> 24 1 0 F >> 25 2 6 AB >> 26 2 6 AB >> 27 2 6 AB >> 28 2 6 AB >> 29 2 6 AC >> 30 2 6 AC >> 31 2 6 AC >> 32 2 6 AC >> 33 2 6 AD >> 34 2 6 AD >> 35 2 6 AD >> 36 2 6 AD >> 37 2 6 AE >> 38 2 6 AE >> 39 2 6 AE >> 40 2 6 AE >> 41 2 6 AF >> 42 2 6 AF >> 43 2 6 AF >> 44 2 6 AF >> 45 2 0 BC >> 46 2 0 BC >> 47 2 0 BC >> 48 2 0 BC >> 49 2 0 BD >> 50 2 0 BD >> 51 2 0 BD >> 52 2 0 BD >> 53 2 0 BE >> 54 2 0 BE >> 55 2 0 BE >> 56 2 0 BE >> 57 2 0 BF >> 58 2 0 BF >> 59 2 0 BF >> 60 2 0 BF >> 61 2 0 CD >> 62 2 0 CD >> 63 2 0 CD >> 64 2 0 CD >> 65 2 0 CE >> 66 2 0 CE >> 67 2 0 CE >> 68 2 0 CE >> 69 2 0 CF >> 70 2 0 CF >> 71 2 0 CF >> 72 2 0 CF >> 73 2 0 DE >> 74 2 0 DE >> 75 2 0 DE >> 76 2 0 DE >> 77 2 0 DF >> 78 2 0 DF >> 79 2 0 DF >> 80 2 0 DF >> 81 2 0 EF >> 82 2 0 EF >> 83 2 0 EF >> 84 2 0 EF >> 85 3 4 ABC >> 86 3 4 ABC >> 87 3 4 ABC >> 88 3 4 ABC >> 89 3 4 ABD >> 90 3 4 ABD >> 91 3 4 ABD >> 92 3 4 ABD >> 93 3 4 ABE >> 94 3 4 ABE >> 95 3 4 ABE >> 96 3 4 ABE >> 97 3 4 ABF >> 98 3 4 ABF >> 99 3 4 ABF >> 100 3 4 ABF >> 101 3 4 ACD >> 102 3 4 ACD >> 103 3 4 ACD >> 104 3 4 ACD >> 105 3 4 ACE >> 106 3 4 ACE >> 107 3 4 ACE >> 108 3 4 ACE >> 109 3 4 ACF >> 110 3 4 ACF >> 111 3 4 ACF >> 112 3 4 ACF >> 113 3 4 ADE >> 114 3 4 ADE >> 115 3 4 ADE >> 116 3 4 ADE >> 117 3 4 ADF >> 118 3 4 ADF >> 119 3 4 ADF >> 120 3 4 ADF >> 121 3 4 AEF >> 122 3 4 AEF >> 123 3 4 AEF >> 124 3 4 AEF >> 125 3 0 BCD >> 126 3 0 BCD >> 127 3 0 BCD >> 128 3 0 BCD >> 129 3 0 BCE >> 130 3 0 BCE >> 131 3 0 BCE >> 132 3 0 BCE >> 133 3 0 BCF >> 134 3 0 BCF >> 135 3 0 BCF >> 136 3 0 BCF >> 137 3 0 BDE >> 138 3 0 BDE >> 139 3 0 BDE >> 140 3 0 BDE >> 141 3 0 BDF >> 142 3 0 BDF >> 143 3 0 BDF >> 144 3 0 BDF >> 145 3 0 BEF >> 146 3 0 BEF >> 147 3 0 BEF >> 148 3 0 BEF >> 149 3 0 CDE >> 150 3 0 CDE >> 151 3 0 CDE >> 152 3 0 CDE >> 153 3 0 CDF >> 154 3 0 CDF >> 155 3 0 CDF >> 156 3 0 CDF >> 157 3 0 CEF >> 158 3 0 CEF >> 159 3 0 CEF >> 160 3 0 CEF >> 161 3 0 DEF >> 162 3 0 DEF >> 163 3 0 DEF >> 164 3 0 DEF >> >> > -- > Michael > http://www.dewey.myzen.co.uk/home.html >-- Yours sincerely, Justin *I check my email at 9AM and 4PM everyday* *If you have an EMERGENCY, contact me at +447938674419(UK) or +60125056192(Malaysia)* [[alternative HTML version deleted]]