Hello,
I am trying to make a design matrix for limma and include date to account for batch effects, but when I construct the matrix, one of the dates is excluded for some reason (1/7/2014).  I am interested in comparing the effects of diet within males and females separately.  Any ideas why this date would be excluded?  This is the targets frame that I read into R:

Name    FileName             Sex         PaternalDiet       Date
498         498 Julia_01072014_(MoGene-2_0-st).CEL           female  c              1/7/2014
594         594 Julia_01082014_(MoGene-2_0-st).CEL           female  c              1/8/2014
721         721 Julia_01072014_(MoGene-2_0-st).CEL           female  c              1/7/2014
731         731 Julia_01092014_(MoGene-2_0-st).CEL           female  c              1/9/2014
766         766 Julia_01092014_(MoGene-2_0-st).CEL           female  c              1/9/2014
439         439 Julia_01092014_(MoGene-2_0-st).CEL           female  d             1/9/2014
448         448 julia_01072014_(MoGene-2_0-st).CEL           female  d             1/7/2014
475         475 Julia_01082014_(MoGene-2_0-st).CEL           female  d             1/8/2014
575         575 Julia_01072014_(MoGene-2_0-st).CEL           female  d             1/7/2014
704         704 julia_01072014_(MoGene-2_0-st).CEL           female  d             1/7/2014
749         749 Julia_01082014_(MoGene-2_0-st).CEL           female  d             1/8/2014
500         500 Julia_01092014_(MoGene-2_0-st).CEL           female  s              1/9/2014
524         524 Julia_02042014_(MoGene-2_0-st).CEL           female  s              2/4/2014
580         580 Julia_01072014_(MoGene-2_0-st).CEL           female  s              1/7/2014
710         710 Julia_01092014_(MoGene-2_0-st).CEL           female  s              1/9/2014
778         778 Julia_01082014_(MoGene-2_0-st).CEL           female  s              1/8/2014
797         797 Julia_01092014_(MoGene-2_0-st).CEL           female  s              1/9/2014
472         472 Julia_01082014_(MoGene-2_0-st).CEL           male      c              1/8/2014
570         570 Julia_01082014_(MoGene-2_0-st).CEL           male      c              1/8/2014
573         573 Julia_01092014_(MoGene-2_0-st).CEL           male      c              1/9/2014
735         735 Julia_01072014_(MoGene-2_0-st).CEL           male      c              1/7/2014
737         737 Julia_01092014_(MoGene-2_0-st).CEL           male      c              1/9/2014
771         771 Julia_01082014_(MoGene-2_0-st).CEL           male      c              1/8/2014
442         442 Julia_01092014_(MoGene-2_0-st).CEL           male      d             1/9/2014
452         452 Julia_01082014_(MoGene-2_0-st).CEL           male      d             1/8/2014
579         579 Julia_01092014_(MoGene-2_0-st).CEL           male      d             1/9/2014
636         636 Julia_01082014_(MoGene-2_0-st).CEL           male      d             1/8/2014
751         751Julia_01072014_(MoGene-2_0-st).CEL            male      d             1/7/2014
754         754 Julia_01092014_(MoGene-2_0-st).CEL           male      d             1/9/2014
503         503 Julia_01092014_(MoGene-2_0-st).CEL           male      s              1/9/2014
585         585 Julia_01082014_(MoGene-2_0-st).CEL           male      s              1/8/2014
660         660 Julia_01072014_(MoGene-2_0-st).CEL           male      s              1/7/2014
714         714 Julia_01072014_(MoGene-2_0-st).CEL           male      s              1/7/2014
762         762 Julia_01082014_(MoGene-2_0-st).CEL           male      s              1/8/2014
779         779 Julia_01082014_(MoGene-2_0-st).CEL           male      s              1/8/2014
470         470 Julia_02042014_(MoGene-2_0-st).CEL           female  c              2/4/2014

This is the code that  I used, and the resulting design matrix:

> targets <- readTargets("targets.txt", row.names="Name")
> DS <- paste(targets$PaternalDiet, targets$Sex, sep=".")
> DS<-factor(DS, levels=c("c.female","d.female","s.female","c.male","d.male","s.male"))
> design <- model.matrix(~0+DS+Date, targets)
> design
    DSc.female DSd.female DSs.female DSc.male DSd.male DSs.male Date1/8/2014
498          1          0          0        0        0        0            0
594          1          0          0        0        0        0            1
721          1          0          0        0        0        0            0
731          1          0          0        0        0        0            0
766          1          0          0        0        0        0            0
439          0          1          0        0        0        0            0
448          0          1          0        0        0        0            0
475          0          1          0        0        0        0            1
575          0          1          0        0        0        0            0
704          0          1          0        0        0        0            0
749          0          1          0        0        0        0            1
500          0          0          1        0        0        0            0
524          0          0          1        0        0        0            0
580          0          0          1        0        0        0            0
710          0          0          1        0        0        0            0
778          0          0          1        0        0        0            1
797          0          0          1        0        0        0            0
472          0          0          0        1        0        0            1
570          0          0          0        1        0        0            1
573          0          0          0        1        0        0            0
735          0          0          0        1        0        0            0
737          0          0          0        1        0        0            0
771          0          0          0        1        0        0            1
442          0          0          0        0        1        0            0
452          0          0          0        0        1        0            1
579          0          0          0        0        1        0            0
636          0          0          0        0        1        0            1
751          0          0          0        0        1        0            0
754          0          0          0        0        1        0            0
503          0          0          0        0        0        1            0
585          0          0          0        0        0        1            1
660          0          0          0        0        0        1            0
714          0          0          0        0        0        1            0
762          0          0          0        0        0        1            1
779          0          0          0        0        0        1            1
470          1          0          0        0        0        0            0
    Date1/9/2014 Date2/4/2014
498            0            0
594            0            0
721            0            0
731            1            0
766            1            0
439            1            0
448            0            0
475            0            0
575            0            0
704            0            0
749            0            0
500            1            0
524            0            1
580            0            0
710            1            0
778            0            0
797            1            0
472            0            0
570            0            0
573            1            0
735            0            0
737            1            0
771            0            0
442            1            0
452            0            0
579            1            0
636            0            0
751            0            0
754            1            0
503            1            0
585            0            0
660            0            0
714            0            0
762            0            0
779            0            0
470            0            1
attr(,"assign")
[1] 1 1 1 1 1 1 2 2 2
attr(,"contrasts")
attr(,"contrasts")$DS
[1] "contr.treatment"

attr(,"contrasts")$Date
[1] "contr.treatment"

Thanks for your help!
Julia

	[[alternative HTML version deleted]]

