Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

I have a panel of bond spreads. Spreads are from a specific issuer (firm) and maturity (eg 2, 4, etc years). The problem is that Stata's tsset (or xtreg) command takes two variables to set the data structure. In my case no two variables uniquely identifies each observation.

If I do: tsset issuer_id Date

I get the error: repeated time values within panel

My data looks like the following:

Issuer   Date   Spread Maturity IndependtVar1 IndependentVar2 ...
Issuer1  apr12  2.2    2           ...
Issuer1  apr12  3.3    4
...
Issuer2  apr12  2.5    2
Issuer2  apr12  2.8    4
...

Is there any way around this? (except for converting to a wide-format data, eg a separate spread variable for each maturity)

Thank you

share|improve this question
tsset is preparation for time series analysis. Are you proposing to conduct time series with more than one variable serving the role of time? Or what? Please be specific about what you are attempting to accomplish. – whuber Oct 7 '12 at 19:19
@whuber I am planning to run the regression: spread = Maturity + IndependentVar1 + IndependentVar2 + .. + Issuer2(Dummy) + Issuer3(Dummy) +... Thanks – luffe Oct 7 '12 at 20:45
Since there's no time in that regression, why are you considering tsset? – whuber Oct 7 '12 at 20:56
@whuber Oh sorry, I forgot to mention that I would like to have the option to run time series commands like ac and dfuller (autocorrelation plot, unit root test). And I also wish to use Newey-West standard errors, and the "newey" command requires a tsset. Thank you – luffe Oct 7 '12 at 21:05
OK-but what sense would these commands make when you aren't actually including time as a variable in your regression? – whuber Oct 8 '12 at 15:31
show 3 more comments

1 Answer

up vote 1 down vote accepted

Solution: egen id=group(Issuer Maturity) tsset id Date

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer: please explain why you're recommending it as a solution. Answers that don't explain anything will be deleted. See Good Subjective, Bad Subjective for more information.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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