Announcement

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

  • Removing data points

    Before I begin, I understand the implications of this and I am only doing this as a test (not as a legitimate means of comparison)

    I created a two way graph with standardized residuals on the y axis and BMI on the x axis. If I want to remove all data points that have standardized residuals greater than 2 and less than -2, how would I do that? To clarify, I created a SLR with heart rate and BMI. Using that model, I created a new variable with standardized residual points. I then plotted a two way graph of standardized residual points and BMI. To test some assumptions of the SLR, I want to see the differences between removing points greater than 2 and less than -2. So I would want to remove data from both heart rate variable and BMI that is associated with standardized residual points greater than 2 and less than -2.

    Thank you.

  • #2
    I'm having a hard time understanding what you are looking for. What is an SLR for example? Does it stand for standard linear regression? As in, OLS (ordinary least squares)? Do you want to rerun the regression without the observations producing extreme residuals?

    Comment


    • #3
      Is this what you'd like?

      Code:
      sysuse auto, clear
      
      reg price mpg trunk weight
      predict rstand, rstandard
      replace rstand=. if abs(rstand)>2
      
      reg price mpg trunk weight if rstand!=.

      Comment

      Working...
      X