+ Reply to Thread
Results 1 to 14 of 14

The trendlines on a logarithmic axis seems off

  1. #1
    Registered User
    Join Date
    11-04-2017
    Location
    Cologne
    MS-Off Ver
    2016
    Posts
    6

    Question The trendlines on a logarithmic axis seems off

    I want to draw a trendline on my timeseries chart, but it seems to start off at the wrong position. Both with linear and logarithmic trendlines. Any ideas?

    Capture.PNG

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,158

    Re: The trendlines on a logarithmic axis seems off

    Please attach your file. Under the text box where you type your reply click the Go Advanced button. On the next screen scroll down and click on Manage Attachments, which will show a pop-up window to Select and Upload a file. Then close the window and Submit your post.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    11-04-2017
    Location
    Cologne
    MS-Off Ver
    2016
    Posts
    6

    Re: The trendlines on a logarithmic axis seems off

    Here's the corresponding excel file
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-04-2017
    Location
    Cologne
    MS-Off Ver
    2016
    Posts
    6

    Re: The trendlines on a logarithmic axis seems off

    And here's what I'm trying to achieve.

    Attachment 546024

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: The trendlines on a logarithmic axis seems off

    I can't see your second attachment. In the first, try an exponential trendline.
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Registered User
    Join Date
    11-04-2017
    Location
    Cologne
    MS-Off Ver
    2016
    Posts
    6
    Quote Originally Posted by shg View Post
    I can't see your second attachment. In the first, try an exponential trendline.
    It invalidated it for some reason. Here it is again.

    Also, I tried all the integrated trend lines, nothing works out of the box. I even tried calculating the logarithmic regression parameters based directly off the data, still I'm not even close to the trendline in this image.
    Attached Images Attached Images

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: The trendlines on a logarithmic axis seems off

    Post the second workbook as you did the first.

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,158

    Re: The trendlines on a logarithmic axis seems off

    I don't have the solution yet but I have found that:

    • If you select an exponential trendline, it will be plotted on this logarithmic scale as a straight line that goes from the first to last point.
    • If you use a linear scale instead of a logarithmic scale, the trendline will be plotted from the first point to the last point. I don't know why it shows only a portion of this line on a logarithmic scale.
    • I have not been able to find a curve type that is a better fit than the exponential curve.

  9. #9
    Registered User
    Join Date
    11-04-2017
    Location
    Cologne
    MS-Off Ver
    2016
    Posts
    6
    Quote Originally Posted by shg View Post
    Post the second workbook as you did the first.
    I had to leave for a bit, I'll post it as soon as I return home in a few hours

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: The trendlines on a logarithmic axis seems off

    Power function ...
    Attached Files Attached Files
    Last edited by shg; 11-04-2017 at 06:38 PM.

  11. #11
    Registered User
    Join Date
    11-04-2017
    Location
    Cologne
    MS-Off Ver
    2016
    Posts
    6

    Re: The trendlines on a logarithmic axis seems off

    Hi shg,

    This is already great, thank you! Would you care explaining a bit how you arrived at this result?

    Also, here is the most recent workbook, as promised.
    Attached Files Attached Files

  12. #12
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: The trendlines on a logarithmic axis seems off

    linest(ln(y), ln(x)) computes the coefficients of the power function regression ln(y) = m * ln(x) + b, which is reconstructed as y = exp(b) * x ^ m. But linest used in that fashion for that data returns a value for m of about 138, and you can't raise a date value in the neighborhood on 40,000 to the 138th power in double-precision floating point -- it overflows.

    So I calculated instead linest(ln(y), ln(x - offset)), and calculated the result as y = b * (x - offset) ^ m
    Last edited by shg; 11-07-2017 at 10:38 AM.

  13. #13
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: The trendlines on a logarithmic axis seems off

    Correction to chart axes ...
    Attached Files Attached Files

  14. #14
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: The trendlines on a logarithmic axis seems off

    I added the other regression so you can compare.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Logarithmic y-axis with different base
    By damp in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-16-2015, 06:16 PM
  2. Why is the second plot not using the logarithmic x axis?
    By DaveSnelling in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 03-24-2014, 07:23 PM
  3. Logarithmic x-axis
    By nsv in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 11-09-2006, 03:35 AM
  4. [SOLVED] In the x axis, logarithmic scale
    By Charles in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 04-20-2006, 01:20 PM
  5. logarithmic scale on x-axis
    By Daniel in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-08-2006, 10:30 PM
  6. [SOLVED] Logarithmic axis
    By Peter Svendsen in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 07-06-2005, 08:05 AM
  7. Re: Logarithmic Trendlines in Excel
    By Quazz in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-06-2005, 08:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1