Hi Gordon and all,
I'm analysing two experiments: 'experiment1', and 'experiment2', where the samples from each experiments are clustered separately in PCA.
In each experiment, two individuals (1,2) were tested repeatedly in 4 different conditions: 'A24','C24','A30','C30'.
But please note: the two individuals tested in the first experiment are NOT the same individuals tested in the second experiment.
so, in summary:
experiment group individual
experiment1 'A24' 1
experiment1 'C24' 1
experiment1 'A30' 1
experiment1 'C30' 1
experiment1 'A24' 2
experiment1 'C24' 2
experiment1 'A30' 2
experiment1 'C30' 2
experiment2 'A24' 1
experiment2 'C24' 1
experiment2 'A30' 1
experiment2 'C30' 1
experiment2 'A24' 2
experiment2 'C24' 2
experiment2 'A30' 2
experiment2 'C30' 2
I want to test how 'group' effects expression, specifically to compare 'A24' to 'C24', and A30 to C30.
So, based on the above, is the following design matrix correct ?
design <- model.matrix(~group+experiment+experiment:individual, data=y$samples)
below is how the design matrix looks like.
Many thanks, Assaf
> design
(Intercept) groupA30 groupC24 groupC30 experiment2
xA24B 1 0 0 0 0
xA24C 1 0 0 0 0
xC24B 1 0 1 0 0
xC24C 1 0 1 0 0
xA30B 1 1 0 0 0
xA30C 1 1 0 0 0
xC30B 1 0 0 1 0
xC30C 1 0 0 1 0
yA24A 1 0 0 0 1
yA24B 1 0 0 0 1
yC24A 1 0 1 0 1
yC24B 1 0 1 0 1
yA30A 1 1 0 0 1
yA30B 1 1 0 0 1
yC30A 1 0 0 1 1
yC30B 1 0 0 1 1
experiment1:individual2 experiment2:individual2
xA24B 0 0
xA24C 1 0
xC24B 0 0
xC24C 1 0
xA30B 0 0
xA30C 1 0
xC30B 0 0
xC30C 1 0
yA24A 0 0
yA24B 0 1
yC24A 0 0
yC24B 0 1
yA30A 0 0
yA30B 0 1
yC30A 0 0
yC30B 0 1