Announcement

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

  • Plotting robust fit

    Hi, I made a simple linear regression and I used a scatter plot to show it visually. I was trying to lessen the impact of outliers on my regression, so I made a robust regression. I'm just not sure how I make a new scatterplot with the robust fit line on it to show the difference between the two. I want to show a comparison of two scatter plots, my original simple regression one and a 2nd with the robust fit line over top the linear fit. I made a weight variable "w" for the robust model.

  • #2
    Sorry for bumping, but can anyone help me? My code was: "graph (scatter enroll crime) (lfit enroll crime)" ... The lfit part plotted the linear regression line, but how do I now plot my robust fit regression line that I've computed? How about: "graph twoway (scatter enroll crime)(lfit enroll crime)(lfit enroll crime [weight=w])" ?
    Last edited by cash addict; 13 Nov 2020, 18:16.

    Comment


    • #3
      There are at least two possible reasons why your post didn't get an answer.

      Not using a full real name, contrary to our request at https://www.statalist.org/forums/help#realnames

      Not telling us how you made a robust regression. It's not clear what weights have to do with that as you don't tell us anything -- even in #2 -- about the variable w. . https://www.statalist.org/forums/help#stata explains how to give a data example and code.

      The help for twoway lfit indicates that it supports weights, so if weights somehow produced a robust fit, then your command might be good.

      Comment


      • #4
        [Not repeated on purpose.]
        Last edited by Nick Cox; 13 Nov 2020, 18:36.

        Comment

        Working...
        X