Announcement

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

  • lincom command with same variable after sureg

    Dear all,

    I am running a Seemingly-Unrelated-Regression using -sureg- for 80 banks. Brief background: the purpose is to test whether there is, on average, a statistically significant change in stock prices on the event day.
    Code:
    local subsetvar HSBC-UBS
    sureg (`subsetvar' = StoxxGlobal1800 eventdaypre eventday eventdaypost)
    Then I want to test if the average of the eventday dummy of all 80 regressions is equal to 0. For this I have successfully used this code so far:
    Code:
    lincom ([HSBC]eventday+.....+[UBS]eventday)/80
    This code is very long for 80 banks. So I wanted to ask how to shorten the code? For example with a loop and a macro.

    I have already read the help file from -lincom- and other threads in the forum, however, I did not come up with a solution.
    Thanks for the help.

    Best,
    Oscar
    (Stata 16)

  • #2
    Code:
    local subsetvar HSBC Barclays JPMorgan Citi UBS
    local banks
    foreach bank of local subsetvar{
        local banks "`banks' [`bank']eventday+ "
    }
    di "`banks'"

    So the command line becomes

    Code:
    lincom (`banks'0)/80
    Res.:

    Code:
    . di "`banks'"
     [HSBC]eventday+  [Barclays]eventday+  [JPMorgan]eventday+  [Citi]eventday+  [UBS]eventday+

    Comment

    Working...
    X