Announcement

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

  • Plot predictions after xthreg

    Hello Statalist,

    I have experimental panel data und used xthreg to estimate a threshold function (with one threshold).

    Here is the output (it looks good and somehow as expected):

    Click image for larger version

Name:	output.PNG
Views:	1
Size:	30.9 KB
ID:	1542141


    I now would like to plot this piecewise function with 95% confidence intervals.

    The command margins, at(wealth2=(1(1)209)) ignores the "kink" at 115.9 and only gives me a linear prediction.
    (I put it then into coefplot, that looks good besides being linear...)

    Do you know how I can create predictions that take care of the threshold after xthreg? Thanks!

  • #2
    Note, xthreg is written Q. Wang in Stata Journal 15.1:
    Code:
    SJ-15-1 st0373  . . . . . . . . Fixed-effect panel threshold model using Stata
            (help xthreg if installed)  . . . . . . . . . . . . . . . . .  Q. Wang
            Q1/15   SJ 15(1):121--134
            fits the fixed-effect panel threshold model
    Since it appear that -xthreg- is calling -xtreg- after determining the threshold and generating a categorical variable (_cat) I believe you will need to construct this graph in parts:

    Code:
    webuse grunfeld,clear
    xthreg invest, rx(kstock) qx(kstock)
    //Threshold at 1099
    margins ,at(_cat == 0 kstock==(500(100)1100)) saving(file1,replace)
    margins ,at(_cat == 1 kstock==(1100(100)1500)) saving(file2,replace)
    use file1,clear
    append using file2
    line _margin _at2

    Comment


    • #3
      Thank you very much!

      Comment

      Working...
      X