Extracting outliers from linear regression analysis

DataGraph Forums Technical Support Support Desk Extracting outliers from linear regression analysis

Tagged: ,

  • This topic has 4 replies, 2 voices, and was last updated 4 years ago by kourosh kalayeh.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #5186
    kourosh kalayeh
    Participant

      Hi,

      I was wondering how I can extract the outliers from the fit command so I can show them on the graph.  Below is the example of what I am trying to do,

      In this screenshot I have fit command and I have select to remove the outliers from the fit,

      Screen Shot 2020-11-09 at 12.57.01 PM

      Now, how can I extract these outliers (or their row numbers, etc.) so I can get something like below (use x to identify the outliers),

      Screen Shot 2020-11-09 at 12.59.41 PM

       

      Thanks as always,
      Kourosh

      #5187
      dgteam
      Moderator

        You can use the Extract as Column option to get a column that shows the values included in the fit.  Rows of data that are not included will be blank in the extract columns.

        Regression

        Then you could layer two points commands to indicate the data in the fit and the outliers.

        RegressionPlot

         

        Does this help?

         

        #5188
        kourosh kalayeh
        Participant

          Hi,

          Thanks for the response.

          It sort of works, but if I understand your method correctly, the two points command need to have same marker so one can go on top of the other.  Ideally, I want to have something similar to my screenshot where I can cross the outliers explicitly.

          Thanks,
          Kourosh

          #5190
          dgteam
          Moderator

            I see what you mean.  Try this …

            Use a logical statement in an Expression column to check if “x” and “X Values” are the same.  The statement will return “1” when they match and “0” when they don’t.

            Then you have a column of ones and zeros that identifies the outliers.  Use this “Included” column in a mask in a separate points command and set the marker style  to a symbol to mark them as crossed out.

            Regression_Outlier

            It seems like having an “Include” column as one of the “Extract column” options would be useful for future versions.

            #5191
            kourosh kalayeh
            Participant

              Great, perfect work around.

              I could not agree more on having “Include” option for “Extract column” in future versions.

              Thanks for making DataGraph the best graphing software.

              Kourosh

            Viewing 5 posts - 1 through 5 (of 5 total)
            • You must be logged in to reply to this topic.

            DataGraph Forums Technical Support Support Desk Extracting outliers from linear regression analysis