check code for Type III in R [🇷 for BE/BA]
Hi WHM,
Your code -at a quick glance- looks ok, but this is said without having tried it on data.
You should not necessarily just think that whatever comes out of SAS is what you want to reproduce.
Type III means you will take out each of the various factors one by one wile keeping the others in the model. Your differences in residuals vs the full model residual correspond to the Type III SS for the individual factors. By that definition sequence will not have any appreciable SS (apart from the numerical precision) and precisely that is what you will find in R with drop1. Think about it this way: Sequence is a between-subject factor; you cannot force in an extra column for Sequence RT or TR in the design matrix since any such column can be constructed from the Subject columns and the intercepts with a little addition and subtraction.
SAS will (with the random bogus statement) goa step further and get you a type III SS for the Sequence. This is not plain type III, but perhaps called type III with a useful twist. I will leave the interpretation to you but note that R's output with drop1 is not 'wrong'.
❝ I've tried drop1() mentioned prior posts but it did now show all SAS showed.
Your code -at a quick glance- looks ok, but this is said without having tried it on data.
You should not necessarily just think that whatever comes out of SAS is what you want to reproduce.
Type III means you will take out each of the various factors one by one wile keeping the others in the model. Your differences in residuals vs the full model residual correspond to the Type III SS for the individual factors. By that definition sequence will not have any appreciable SS (apart from the numerical precision) and precisely that is what you will find in R with drop1. Think about it this way: Sequence is a between-subject factor; you cannot force in an extra column for Sequence RT or TR in the design matrix since any such column can be constructed from the Subject columns and the intercepts with a little addition and subtraction.
SAS will (with the random bogus statement) goa step further and get you a type III SS for the Sequence. This is not plain type III, but perhaps called type III with a useful twist. I will leave the interpretation to you but note that R's output with drop1 is not 'wrong'.
—
Pass or fail!
ElMaestro
Pass or fail!
ElMaestro
Complete thread:
- check code for Type III in R WHM 2015-02-16 07:54 [🇷 for BE/BA]
- check code for Type III in RElMaestro 2015-02-16 12:17
- check code for Type III in R WHM 2015-02-24 01:56
- check code for Type III in R ElMaestro 2015-02-24 09:59
- check code for Type III in R WHM 2015-02-24 01:56
- check code for Type III in RElMaestro 2015-02-16 12:17