Forum Discussion

jshumaker's avatar
jshumaker
Frequent Visitor
3 years ago
Solved

linest grouping

is it possible to return multiple rows back from a linestx function?  Running one regression model at a time is not good enough as I need to have a line chart with a legend showing multiple lines at the same time

  • The LINESTX function itself always returns a single row, containing the result of a single least squares regression.

     

    However, if you placed a particular column as the legend of a line chart, a measure that used LINESTX would carry out the regression for each value of that column.

     

    Could you give some more detail on how you would want your visual to work along with sample data?

  • jshumaker 

    Apologies - I was sidetracked and didn't respond to your reply!

    You have likely resolved this since your last post!

     

    I had a play around in any case. (My regression measure is probably not identical to yours)

     

    The built-in line chart can't display two measures if a legend is included, but I created a line chart showing the y Estimate (bottom chart).

     

    You could also use the built-in trend line regression, which should give the same result (top chart).

     

    Hopefully this is useful if you are still looking at this.

     

    Regards,

3 Replies

  • The LINESTX function itself always returns a single row, containing the result of a single least squares regression.

     

    However, if you placed a particular column as the legend of a line chart, a measure that used LINESTX would carry out the regression for each value of that column.

     

    Could you give some more detail on how you would want your visual to work along with sample data?

  • jshumaker's avatar
    jshumaker
    Frequent Visitor

    here is my matrix of the data that I want to run a regression model on and a line chart of the actual values



     

     

    • OwenAuger's avatar
      OwenAuger
      Super User

      jshumaker 

      Apologies - I was sidetracked and didn't respond to your reply!

      You have likely resolved this since your last post!

       

      I had a play around in any case. (My regression measure is probably not identical to yours)

       

      The built-in line chart can't display two measures if a legend is included, but I created a line chart showing the y Estimate (bottom chart).

       

      You could also use the built-in trend line regression, which should give the same result (top chart).

       

      Hopefully this is useful if you are still looking at this.

       

      Regards,