title: Create a case control pair for time stratified case-crossover design
body: <p>I plan to design a study using a time stratified case crossover approach, in which each
  case serves as his own control. Control days have to be on the same
  weekday of the same month.  If a person is admitted to hospital on Friday in
  a certain Month, then all other Fridays in that month will be control days. Depending on the date of admission and month, there will be 3 or 4 controls.</p>
  
  <p>For instance, if a person is admitted to hospital today (27.12.2013), all
  Fridays in December (6th, 13th and 20th) will be controls, thus providing 3 controls.
  On the other hand, if another patient is admitted on the New Year, Wednesday 1, 1, 2014, all other Wednesdays of January 2014 (8,15,22 and 29)  will be control days.</p>
  
  <p>The dput below shows the event days which I currently have( event_date) and the intended control days(referent date).
  How could I setup such scheme? T</p>
  
  <pre><code>structure(list(event_date = structure(c(12539, 12539, 12539, 
  12539, 12544, 12544, 12544, 12545, 12545, 12545, 12550, 12550, 
  12550, 12563, 12563, 12563, 12567, 12567, 12567, 12567, 14065, 
  14065, 14065), class = "Date"), referent_date = structure(c(12546, 
  12560, 12567, 12553, 12558, 12565, 12551, 12566, 12552, 12559, 
  12543, 12557, 12564, 12556, 12542, 12549, 12553, 12539, 12546, 
  12560, 14086, 14072, 14079), class = "Date")), .Names = c("event_date", 
  "referent_date"), class = "data.frame", row.names = c("1", "2", 
  "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", 
  "15", "16", "17", "18", "19", "20", "21", "22", "23"))
  </code></pre>