title: Stata - repeated time values within panel
body: <p>I have a dataset that has the following format:</p>
  
  <pre><code>Company|Dependent var|Independent vars|Company ID|Date|dummy1|dummy2
  A|Values|Values|1|01/01/2015|0|1
  A|Values|Values|1|01/01/2015|1|0
  A|Values|Values|1|01/01/2014|1|0
  B|Values|Values|2|01/01/2015|0|1
  B|Values|Values|2|01/01/2014|0|1
  </code></pre>
  
  <p>As you can see, companies can have multiple values at the same period (as they are rated by 2 different agencies). The problem then arises when I use <code>xtset</code> to define my panel data it throws the <code>"repeated time values within panel"</code>. I wish to cluster errors by company and so I define the panel data set using <code>"xtset CompanyID Date"</code>. Is there a way I can get round the error?</p>
  
  <p>I wish to distinguish between the two entries that stata perceives as the same (i.e. but isn't as the dummy variables differentiate between them) but still cluster errors bases on company (using company id). Do I need to create a new id? Will this lose clustering by company?</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Laurence</p>
  
  <p><em>Follow up</em>: Basically I found that I am dealing with what is known as a multidimensional panel (e.g. y_i_j_k) not a 2 dimensional panel (y_i_j) and as such you cant do two dimensional commands on a >2 dimensional panel. As such I needed to reframe the panel 2 two dimensions by creating a new ID (<code>egen newID = group(companyID Dummy1 Dummy2</code>) This then allows you to use two dimensional commands. I think you can then group the data later using cluster (<code>vce(cluster clustervar)</code>). Thanks</p>