Announcement

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

  • How to construct a confidence interval after a chi-square test

    I feel this should be very simple, but my mind is drawing a blank here. Let me describe the situation.

    The starting point is a dynamic panel model, e.g.
    Code:
    xtreg dep L.dep indep L.indep, fe
    The longrun impact of the independent variable can be calculated as
    Code:
    di (_b[indep] + _b[L1.indep])/(1 - _b[L1.dep])
    You can then test whether this long-run impact is significantly different from zero using
    Code:
    testnl (_b[indep] + _b[L1.indep])/(1 - _b[L1.dep]) = 0
    This gives you a test statistic and its p-value, but how do you then turn this into a 95% confidence interval?

    Workable example:
    Code:
    use "http://www.stata-press.com/data/r11/abdata.dta", clear
    xtreg n L.n w L.w, fe
    di (_b[w] + _b[L.w])/(1-_b[L.n])
    testnl (_b[w] + _b[L.w])/(1-_b[L.n]) = 0
    EDIT: I discovered I can do the same using the nlcom command, which does produce confidence intervals, however I'm still interested to figure out what happens behind the scenes... (examining the nlcom.ado file didn't seem to help)
    Last edited by Jesse Wursten; 17 Mar 2017, 07:19.

  • #2
    Jesse,

    We can use the delta method to get an estimate the variance of the long-run impact; the chi-sq statistic is just the square of the estimate of the long-run impact divided be the estimated variance. You can reverse-engineer the test statistic to get the variance and use it to construct a confidence interval

    Best wishes,

    Joao

    Comment

    Working...
    X