Announcement

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

  • How to draw "Plot of residuals with a Lowess line in STATA"

    Could you please help me to draw the graph as the below pic?
    Thanks so much for your all help.
    Click image for larger version

Name:	Capture.PNG
Views:	2
Size:	37.0 KB
ID:	1545068
    Attached Files

  • #2
    I'm not sure of the origin of the residuals - there's no context here and they could be from a regression. But maybe this will help.

    Code:
    webuse lowess1, clear
    lowess  depth h1 , generate(yhat) nograph
    
    gen residuals = depth - yhat
    lowess  residuals yhat
    Alternatively,

    Code:
    webuse lowess1, clear
    reg  depth h1 
    predict yhat 
    predict residuals, resid
    
    lowess  residuals yhat
    Last edited by Justin Niakamal; 06 Apr 2020, 12:45.

    Comment

    Working...
    X