Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • fixed effect panel regression with multiple time series

    Dear stata community

    I have to do a fixed effect panel regression with the difference in ask yield of a bond as y_{i,t} on the difference in bid ask spread x_{i,t}, this a measure for liquidity.

    ∆y ̃i,t = pi +β∆Liquidityi,t +εi,t

    The difference in ask yield is the difference of a certain bond against 2 other bonds issued by the same issuer and the bid ask spread is that the same bond against the same 2 other bonds. the 3 bonds form a triplet together. I have data on 170 differences in ask yield on differences in bid ask spread over a time period between 2015 until 2018. The method i use is that of: Is there a Green Bond Premium? The yield differential between green and conventional bonds by Olivier David Zerbib (2018) https://papers.ssrn.com/sol3/papers....act_id=2889690

    The problem is that i dont understand how i can do a regression off all the y_{i,t} on all the x_{i,t} while still matching the correct y with the correct x. I think i will need to build a matrix to do this but i do not know how that works in stata. How do i have to prepare my data so that i can do a fixed effect panel regression and what do i have to type in the command section to get the answer? At the moment i am working with an excel file where i have daily values of the differences in ask yield and daily values of bid ask spreads over time for each triplet of bonds. Each triplet has a different starting point because the issue date is different.

  • #2
    You didn't get a quick answer. You'll increase your chances of a useful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex.

    We don't even know the structure of your data. You should have the data in long form
    bondsABC year1 yield liquidity
    bondsABC year2 yield liquidity
    bondsABC year3 yield liquidity
    bondBCD year1 yield liquidity
    bondBCD year2 yield liquidity
    bondBCD year2 yield liquidity

    etc. Where yield and liquidity vary for each bond/year.

    You xtset your data telling Stata the panel structure of the panel and then do xtreg. There is no matrix manipulation. You need to read the Getting Started and Users Guide that come with Stata. There are also good introductory books - look at the bookstore on Stata's website then see if they're in your library. Finally, you look at the panel-cross sectional documentation.

    Comment

    Working...
    X