Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

STATA panel data

  • 21-09-2010 5:45pm
    #1
    Closed Accounts Posts: 719 ✭✭✭


    Hi all,

    I have a serious problem, I'm currently doing my thesis and the deadline is looming, I'm doing a regression analysis of Credit Ratings gainst Market risk of companies over a 5 year period. I'm using the data for roughly 80 companies.

    I put the data in panel set using tsset but what I'm unsure of is how to regress the Ratings against the Market risk.
    Below is the code I am using. I'm using Ratings as the dependent variable and Market risk (VaR) as the independent variable for each company. Basically that means I have 80 independent variable's and 80 dependent variables.


    Is it a case of,
    xtreg Ratings Market risk Ratings 1 Market risk 1 etc, fe

    xtreg dependentvar independentvar1 independentvar2 independentvar3 . , fe

    Thanks in advance,

    David


Comments

  • Closed Accounts Posts: 2,208 ✭✭✭Économiste Monétaire


    Did you declare the panelvar when you used tsset?


  • Closed Accounts Posts: 719 ✭✭✭Tobyglen


    Hi
    sort panelvar datevar
    tsset panelvar datevar

    I used the Rating as panelvar and date as datevar

    I'm just unsure on how to set the regression up, do I go xtreg dependent dependent 1 etc independent independent 1 etc , fe

    Link I'm using is here

    http://dss.princeton.edu/online_help/analysis/panel.htm

    Thanks


  • Closed Accounts Posts: 2,208 ✭✭✭Économiste Monétaire


    Why did you use rating? Why not

    tsset company date


  • Closed Accounts Posts: 2,208 ✭✭✭Économiste Monétaire


    Your regression is this

    [latex] \displaystyle Rating_{i,t} = \alpha_{i} + \beta_{1} X_{i,t} + \ldots + \epsilon_{i,t}[/latex]

    for company i and year t, correct? Your dependent variable shouldn't be the panelvar.


  • Closed Accounts Posts: 719 ✭✭✭Tobyglen


    Why did you use rating? Why not

    tsset company date
    The point of my thesis is a regression analysis between Credit Ratings of the top European companies (Which I have) and Market risk of the companies at the time.

    I basically want to see what the relationship was between them during the years around the economic crash. My supervisor recommended panel data but he's not an expert on Stata.


  • Advertisement
  • Closed Accounts Posts: 2 Legs


    Hi,

    I also did my thesis relating to credit ratings, but looked at the impact of downgrades on European sovereign debt prices. I presume it's an event study that you're doing to assess the impact of a credit rating change on the market risk of each company around the event date?

    I did mine in excel - it's quite time consuming but can be done once you're somewhat proficient in excel. There's quite a good paper explaining a common methodology which can be used:

    Steiner, M. and Heinke, V. 2001 “Event Study Concerning International Bond Price

    Effects of Credit Rating Actions,” International Journal of Finance and Economics,

    Vol. 6, pp. 139-157

    Best of Luck!


  • Closed Accounts Posts: 719 ✭✭✭Tobyglen


    Your regression is this

    [latex] \displaystyle Rating_{i,t} = \beta_{0} + \beta_{1} X_{i,t} + \ldots + \epsilon_{i,t}[/latex]

    for company i and year t, correct? Your dependent variable shouldn't be the panelvar.
    Could you break that down into code, I'm only learning STATA since last week, thanks.


  • Closed Accounts Posts: 2,208 ✭✭✭Économiste Monétaire


    Depending on what you've used as labels, you may need to alter the code. Try:
    tsset company year
    
    xtreg rating risk, fe
    


  • Closed Accounts Posts: 719 ✭✭✭Tobyglen


    Depending on what you've used as labels, you may need to alter the code. Try:
    tsset company year
    
    xtreg rating risk, fe
    
    Sorry but I'm unsure of what to do with company,
    I have 1,200 (Daily) Risk and Ratings measurements for each company and presumed I just copied them into the data editor along with the date.
    My headings were Date , Ratings, Risk....Ratings 1, Risk 1...etc
    My dependent variable is Rating and independent variable is Risk

    I then coded in
    sort Ratings Date
    tsset Ratings Date

    I then ran a regression analysis by
    xtreg Rating Date Rating1 Date 1 etc, fe

    I'm a bit lost with the company variable you talk about, should I be entering the company names into the dataset?


  • Closed Accounts Posts: 719 ✭✭✭Tobyglen


    Legs wrote: »
    Hi,

    I also did my thesis relating to credit ratings, but looked at the impact of downgrades on European sovereign debt prices. I presume it's an event study that you're doing to assess the impact of a credit rating change on the market risk of each company around the event date?

    I did mine in excel - it's quite time consuming but can be done once you're somewhat proficient in excel. There's quite a good paper explaining a common methodology which can be used:

    Steiner, M. and Heinke, V. 2001 “Event Study Concerning International Bond Price

    Effects of Credit Rating Actions,” International Journal of Finance and Economics,

    Vol. 6, pp. 139-157

    Best of Luck!
    Thanks, I'll report back when I'm finished.


  • Advertisement
  • Closed Accounts Posts: 2,208 ✭✭✭Économiste Monétaire


    Based on this,
    Tobyglen wrote: »
    I'm doing a regression analysis of Credit Ratings gainst Market risk of companies over a 5 year period. I'm using the data for roughly 80 companies.

    regress the Ratings against the Market risk.

    Below is the code I am using. I'm using Ratings as the dependent variable and Market risk (VaR) as the independent variable for each company. Basically that means I have 80 independent variable's and 80 dependent variables.

    I presumed your data looked liked this

    Company|Year|Rating|Risk
    1|1|blah|blah
    1|2|blah|blah
    1|3|blah|blah
    1|4|blah|blah
    1|5|blah|blah
    2|1|blah|blah
    2|2|blah|blah
    2|3|blah|blah
    2|4|blah|blah
    2|5|blah|blah
    3|1|blah|blah
    3|2|blah|blah
    3|3|blah|blah
    3|4|blah|blah
    3|5|blah|blah

    and so on. Here, the panelvar is Company and datevar is Year.


  • Closed Accounts Posts: 719 ✭✭✭Tobyglen


    |Daily date|Rating|Risk
    date|blah|blah
    date|blah|blah
    date|blah|blah
    date|blah|blah
    date|blah|blah
    date|blah|blah
    date|blah|blah
    date|blah|blah
    date|blah|blah
    date|blah|blah
    date|blah|blah
    date|blah|blah
    date|blah|blah
    date|blah|blah
    date|blah|blah

    This is the way my data comes from the exel file, do you think I should look at doing it the way you mention, I have 80 companies and 1,300 dates for each so would it be possible?

    Daily Date on left, Rating then Risk. Thanks


  • Closed Accounts Posts: 2,208 ✭✭✭Économiste Monétaire


    Try it my way. Label each company 1 through 80, and mimic the table I showed above, but using daily data instead of years. Mechanically, there shouldn't be a problem with doing this in Stata.


  • Closed Accounts Posts: 719 ✭✭✭Tobyglen


    Try it my way. Label each company 1 through 80, and mimic the table I showed above, but using daily data instead of years. Mechanically, there shouldn't be a problem with doing this in Stata.


    Thank you, I'll try that, I really appreciate your help, I'll report back tomorrow and let you know how it went.


  • Closed Accounts Posts: 2,208 ✭✭✭Économiste Monétaire


    You're welcome. Best of luck.


Advertisement