Announcement

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

  • Help to plot actual values and predicted values after a xtreg regression

    Hi all,

    I'm working with panel data in my master thesis and have made the following statistical regression.
    xtreg direct i. Revenue_authority i.year lngdp lntrade lnpop lnaid lnnat_res VAT_reform democracy pol_corruption accountability rigorous, fe vce(cluster state)
    Now based on my regression I would like to find a "typical" case to examine in depth in a case study. Therefore i need to plot the actual value of the dependent variable with the regression adjusted predicted values. I have tried (and failed) with the following command.
    predict direct_nested if e(sample)
    twoway (scatter direct direct_nested by(state), name(direct)) (lowess direct direct_nested) (lfit direct direct_nested, legend(off))
    I am hoping someone can help me with a command, so i can make graph alike this:
    Click image for larger version

Name:	nested analysis.jpg
Views:	1
Size:	48.7 KB
ID:	1448849



    Best regards,
    Matilde
Working...
X