Currently I am working on my master thesis which is about risk-adjusted returns (Sharpe ratio) of Asian REITs. I just transformed all the data in variables which are ready to use in Stata.

My data consist of year (2002 till 2012), Key (cusip identifier), Country, and all sorts of firm specific characteristics.

For declaring a panel data in Stata, we have to declare two variables - Panel and Time.

But Time variable must be unique, that is, no duplicate time in each panel. But when I declare "Country" as panel variable and "Year" as time variable, there is a problem. Problem is the duplicate year in each panel. For example, Japan has several entries for the year 2002. But for panel data there should not duplicate time values.

I think I need to define a unique time variable or drop time variable from the analysis. Using only panel variable I can run panel data regression, but time series analysis such as unit root can't be run. So, question is how I declare a time variable?


1 Answer 1


Your emphasis is likely to be the wrong way round. Throwing away time as a variable is unlikely to be the best way forward.

You need to think hard about what is a panel. If you really want countries to be panels, then you may need to average or otherwise combine repeated observations for the same country and the same year.

But it sounds as if your panels are firms. If so, firm should be the panel identifier.

I don't know what cusip identifier is.

Reading list:



  • $\begingroup$ I'll take a look at the readings, thnx! $\endgroup$
    – Henk
    Commented May 7, 2013 at 22:42
  • $\begingroup$ Hello Nick, a cusip is a number that identifies securities. In case of my research the cusip code is a unique key that links the various characteristics to individual firms. So the panels are indeed firms. But if I want to analyse, lets say, the counties (which than will serve as a panel) I have to average all the firm's result (sharpe ratio, dividend yield, etc.) in that year. This way the problem of 'repeated observations' is eliminated? TCan you tell if i I correctly understood you? Thnx $\endgroup$
    – Henk
    Commented May 8, 2013 at 12:23
  • $\begingroup$ Best to look at it backwards. If you want to use any method that requires tsset or xtset first, then you must have no more than one (panel identifier, time) pair. But you can define panels as (country, firm) pairs and that's often a good idea. See stata-journal.com/sjpdf.html?articlenum=dm0034 for technique. egen panel = group(country firm), label would be an example. $\endgroup$
    – Nick Cox
    Commented May 8, 2013 at 12:28
  • $\begingroup$ This question on statalist might help you. $\endgroup$
    – Metrics
    Commented May 9, 2013 at 10:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.