Loading ...
Sorry, an error occurred while loading the content.

Re: [ploticus] linear regression

Expand Messages
  • dylan
    on 04.3.31 8:14 AM, jamie.echlin@ubs.com at jamie.echlin@ubs.com was ... you might need to convert the human readable dates into some machine readable format
    Message 1 of 11 , Mar 31, 2004
    • 0 Attachment
      on 04.3.31 8:14 AM, jamie.echlin@... at jamie.echlin@... was
      reported to have writen:

      > Perhaps I'm going about this the wrong way. I'm trying to add forecasting
      > capabilities.
      >
      > Let's say I am measuring daily sales, I want to show what the sales will be in
      > 6 months if current trend continues. I realise this is a bit simplistic but
      > it's all I've come up with for the moment. Hence I tried to fit a regression
      > curve, which is great, except I'm not sure how to use the equation with dates.
      >

      you might need to convert the human readable dates into some machine
      readable format such as a unix timestamp first, do the regression, then
      convert it back for display.

      dylan
    • jamie.echlin@ubs.com
      I did this with oracle in the end, also changed the SQL templates to omitweekends so am no longer bothered about that scaling issue I reported earlier...
      Message 2 of 11 , Apr 1 8:36 AM
      • 0 Attachment
        I did this with oracle in the end, also changed the SQL templates to omitweekends so am no longer bothered about that scaling issue I reported earlier... thanks for listening anyway.
        jamie


        Perhaps I'm going about this the wrong way. I'm trying to add forecasting capabilities.

        Let's say I am measuring daily sales, I want to show what the sales will be in 6 months if current trend continues. I realise this is a bit simplistic but it's all I've come up with for the moment. Hence I tried to fit a regression curve, which is great, except I'm not sure how to use the equation with dates.

        Also, I would like to be able to show the entire span on the graph, eg mar 03 to mar 05, and have the regression line continue so that people can read it off. I appreciate that the formula can accomplish the same thing but people here aren't that techy.

        See example below...

        cheers, jamie


        #proc page
        #if @DEVICE in png,gif
        scale: 1
        #endif



        #proc settings

        omitweekends: omit



        #proc getdata
        #intrailer

        #proc areadef
        title: Licence Information\n\n
        titledetails: size=11 align=C

        # rectangle: 1 1 8 4
        xscaletype: datetime dd-MMM-yyyy.hh:mm
        xautorange: datafield=time
        yautorange: datafield=num,int2,int3,int4
        areacolor: gray(0.9)
        #endproc





        #proc xaxis


        stubs: inc 0


        minorticinc:
        stubformat: dd-Mmm-yy



        label: \nTime


        #proc yaxis
        stubs: inc 0
        grid: color=black
        # # gridskip: min
        # # ticincrement: 100 1000
        label: # Licences
        stubcull: yes

        #proc lineplot
        xfield: time
        yfield: num
        linedetails: color=blue width=2
        legendlabel: Daily Average
        gapmissing: yes

        #proc curvefit
        curvetype: movingavg
        order: 10
        xfield: time
        yfield: num
        linedetails: color=purple width=2 style=1
        legendlabel: Rolling Average

        #proc lineplot
        xfield: time
        yfield: int2
        linedetails: color=teal width=2
        legendlabel: Daily Max
        gapmissing: yes

        stairstep: yes


        // do regression curve..
        #proc curvefit
        curvetype: regression
        xfield: time
        yfield: int2
        linedetails: color=red width=0.5

        // do annotation in lower right corner..
        #proc annotate
        location: max min-0.4
        textdetails: color=red align=R size=6
        text: @REGRESSION_LINE
        r = @CORRELATION
        XFINAL = @XFINAL
        YFINAL = @YFINAL

        #proc lineplot
        xfield: time
        yfield: int3
        linedetails: color=yellow width=2
        legendlabel: Avg Total
        gapmissing: yes

        #proc lineplot
        xfield: time
        yfield: int4
        linedetails: color=magenta width=2
        legendlabel: Distinct Users
        gapmissing: yes

        #proc legend
        location: max-1 max
        seglen: 0.2

        #proc trailer
        fieldnames: time num int2 int3 int4

        Data:
        28-AUG-2003.00:00 180.245614 325 663.157895 0
        29-AUG-2003.00:00 121.90625 310 700 0
        30-AUG-2003.00:00 17.0625 31 700 0
        31-AUG-2003.00:00 16.358696 33 700 0
        01-SEP-2003.00:00 157.229358 383 700 0
        02-SEP-2003.00:00 140.515464 328 700 0
        03-SEP-2003.00:00 142.59375 344 700 0
        04-SEP-2003.00:00 142.125 336 700 0
        05-SEP-2003.00:00 134.53125 329 700 0
        06-SEP-2003.00:00 22.03125 35 700 0
        07-SEP-2003.00:00 16.576087 33 669.565217 0
        08-SEP-2003.00:00 145.53125 394 700 0
        09-SEP-2003.00:00 149.458333 449 700 0
        10-SEP-2003.00:00 145.302083 349 700 0
        11-SEP-2003.00:00 141.270833 351 700 0
        12-SEP-2003.00:00 132.09375 311 700 0
        13-SEP-2003.00:00 25.170455 40 700 0
        14-SEP-2003.00:00 15.607143 27 700 0
        15-SEP-2003.00:00 206.30137 326 700 0
        16-SEP-2003.00:00 145.020833 346 700 0
        17-SEP-2003.00:00 142.614583 328 700 0
        18-SEP-2003.00:00 145.260417 340 700 0
        19-SEP-2003.00:00 124.489583 312 700 0
        20-SEP-2003.00:00 27.84375 66 700 0
        21-SEP-2003.00:00 20.445652 34 700 0
        22-SEP-2003.00:00 142.736842 390 700 0
        23-SEP-2003.00:00 141.395833 339 700 0
        24-SEP-2003.00:00 143.427083 343 700 0
        25-SEP-2003.00:00 135.572917 315 700 0
        26-SEP-2003.00:00 125.625 307 700 0
        27-SEP-2003.00:00 22.114583 36 700 0
        28-SEP-2003.00:00 20.923077 45 700 0
        29-SEP-2003.00:00 142.5 351 700 0
        30-SEP-2003.00:00 146.333333 353 700 0
        01-OCT-2003.00:00 146.822917 349 700 0
        02-OCT-2003.00:00 146.65625 356 700 0
        03-OCT-2003.00:00 139.341772 327 700 0
        04-OCT-2003.00:00 25.09375 38 700 0
        05-OCT-2003.00:00 21.648352 41 700 0
        06-OCT-2003.00:00 147.395833 373 700 0
        07-OCT-2003.00:00 152.177083 368 700 0
        08-OCT-2003.00:00 159.84375 380 700 0
        09-OCT-2003.00:00 159.177083 383 700 0
        10-OCT-2003.00:00 149.135417 369 700 0
        11-OCT-2003.00:00 26.377778 42 700 0
        12-OCT-2003.00:00 17.914286 58 700 0
        13-OCT-2003.00:00 163.541667 397 700 0
        14-OCT-2003.00:00 160.604167 369 700 0
        15-OCT-2003.00:00 161.791667 377 700 0
        16-OCT-2003.00:00 158.895833 382 700 0
        17-OCT-2003.00:00 152.65625 379 700 0
        18-OCT-2003.00:00 22.010417 39 700 0
        19-OCT-2003.00:00 18.891304 56 700 0
        20-OCT-2003.00:00 157.458333 411 700 0
        21-OCT-2003.00:00 158.421053 377 700 0
        22-OCT-2003.00:00 158.083333 370 700 0
        23-OCT-2003.00:00 156.885417 378 700 0
        24-OCT-2003.00:00 145.916667 353 700 0
        25-OCT-2003.00:00 23.802083 41 700 0
        26-OCT-2003.00:00 19.28125 36 700 0
        27-OCT-2003.00:00 159.625 429 700 0
        28-OCT-2003.00:00 162.145833 373 700 0
        29-OCT-2003.00:00 156.1875 367 700 0
        30-OCT-2003.00:00 157.229167 370 700 0
        31-OCT-2003.00:00 144.166667 357 700 0
        01-NOV-2003.00:00 26.104167 41 700 0
        02-NOV-2003.00:00 24 54 700 0
        03-NOV-2003.00:00 155.875 406 700 0
        04-NOV-2003.00:00 153.677083 367 700 0
        05-NOV-2003.00:00 156.802083 376 700 0
        06-NOV-2003.00:00 155.708333 378 700 0
        07-NOV-2003.00:00 136.989583 329 700 0
        08-NOV-2003.00:00 25.21875 43 700 0
        09-NOV-2003.00:00 20.586957 41 700 0
        10-NOV-2003.00:00 156.677083 449 700 0
        11-NOV-2003.00:00 157.333333 355 700 0
        12-NOV-2003.00:00 154.270833 359 700 0
        13-NOV-2003.00:00 158.75 372 700 0
        14-NOV-2003.00:00 148.270833 355 700 0
        15-NOV-2003.00:00 22.195652 36 700 0
        16-NOV-2003.00:00 21.021053 59 655.789474 0
        17-NOV-2003.00:00 159.739583 399 700 0
        18-NOV-2003.00:00 160.697917 378 700 0
        19-NOV-2003.00:00 158.875 387 700 0
        20-NOV-2003.00:00 159.145833 376 700 0
        21-NOV-2003.00:00 144.614583 353 619.791667 0
        22-NOV-2003.00:00 0 0 0 0
        23-NOV-2003.00:00 9.318182 15 700 0
        24-NOV-2003.00:00 173.676056 425 700 358
        25-NOV-2003.00:00 228.52381 374 700 749
        26-NOV-2003.00:00 151.291667 366 700 869
        27-NOV-2003.00:00 151.821053 392 700 863
        28-NOV-2003.00:00 145.46875 377 700 819
        29-NOV-2003.00:00 20.15625 35 700 105
        30-NOV-2003.00:00 17.325581 29 700 88
        01-DEC-2003.00:00 154.302083 391 700 895
        02-DEC-2003.00:00 159.333333 366 700 880
        03-DEC-2003.00:00 154.052083 365 700 865
        04-DEC-2003.00:00 154.510417 374 700 879
        05-DEC-2003.00:00 142.916667 354 700 820
        06-DEC-2003.00:00 20.163043 31 700 108
        07-DEC-2003.00:00 16.450549 34 700 91
        08-DEC-2003.00:00 158.354167 406 700 928
        09-DEC-2003.00:00 157.510417 379 700 857
        10-DEC-2003.00:00 147.260417 355 700 860
        11-DEC-2003.00:00 145.03125 357 700 838
        12-DEC-2003.00:00 130.041667 324 700 807
        13-DEC-2003.00:00 22.012048 39 700 133
        14-DEC-2003.00:00 15.137931 28 700 59
        15-DEC-2003.00:00 168.552941 492 700 1006
        16-DEC-2003.00:00 141.229167 337 700 861
        17-DEC-2003.00:00 140.364583 342 700 827
        18-DEC-2003.00:00 136.09375 329 700 821
        19-DEC-2003.00:00 117.760417 325 700 779
        20-DEC-2003.00:00 15.427083 31 700 67
        21-DEC-2003.00:00 15.032967 39 700 84
        22-DEC-2003.00:00 109.21875 317 700 775
        23-DEC-2003.00:00 101.302083 268 700 650
        24-DEC-2003.00:00 56.75 212 700 459
        25-DEC-2003.00:00 15.989583 33 700 61
        26-DEC-2003.00:00 16.760417 33 700 72
        27-DEC-2003.00:00 13.958333 30 700 52
        28-DEC-2003.00:00 14.144444 32 700 65
        29-DEC-2003.00:00 92.795918 263 700 579
        30-DEC-2003.00:00 94.604167 227 700 547
        31-DEC-2003.00:00 65.28125 211 700 460
        01-JAN-2004.00:00 19.09375 33 700 72
        02-JAN-2004.00:00 71.677083 176 700 446
        03-JAN-2004.00:00 17.260417 28 700 60
        04-JAN-2004.00:00 15.844444 34 700 78
        05-JAN-2004.00:00 142.112245 416 700 884
        06-JAN-2004.00:00 140.645833 329 700 841
        07-JAN-2004.00:00 140.260417 337 700 834
        08-JAN-2004.00:00 141.375 337 700 830
        09-JAN-2004.00:00 138.552083 337 700 807
        10-JAN-2004.00:00 27.489583 49 700 127
        11-JAN-2004.00:00 20.923077 49 700 112
        12-JAN-2004.00:00 156.760417 422 700 942
        13-JAN-2004.00:00 149.927083 360 700 887
        14-JAN-2004.00:00 149.552083 351 700 875
        15-JAN-2004.00:00 149.895833 358 700 852
        16-JAN-2004.00:00 138.791667 340 700 822
        17-JAN-2004.00:00 18.104167 32 700 96
        18-JAN-2004.00:00 17.868132 37 700 97
        19-JAN-2004.00:00 151.894737 399 700 931
        20-JAN-2004.00:00 156.208333 374 700 876
        21-JAN-2004.00:00 152.78125 354 700 892
        22-JAN-2004.00:00 155.09375 370 700 874
        23-JAN-2004.00:00 144.46875 357 700 827
        24-JAN-2004.00:00 21.09375 35 700 114
        25-JAN-2004.00:00 17.844444 36 700 105
        26-JAN-2004.00:00 158.364583 383 700 918
        27-JAN-2004.00:00 155.604167 360 700 857
        28-JAN-2004.00:00 146.833333 346 700 849
        29-JAN-2004.00:00 137.697917 349 700 835
        30-JAN-2004.00:00 136.78125 354 700 797
        31-JAN-2004.00:00 21.583333 33 700 116
        01-FEB-2004.00:00 20.377778 38 700 90
        02-FEB-2004.00:00 150.895833 383 700 923
        03-FEB-2004.00:00 154.210526 356 700 872
        04-FEB-2004.00:00 156.020833 371 700 884
        05-FEB-2004.00:00 158.416667 369 700 901
        06-FEB-2004.00:00 144.614583 348 700 840
        07-FEB-2004.00:00 24.010526 60 700 144
        08-FEB-2004.00:00 17.433333 29 700 97
        09-FEB-2004.00:00 154.96875 431 700 908
        10-FEB-2004.00:00 161.166667 396 700 890
        11-FEB-2004.00:00 161.916667 381 700 896
        12-FEB-2004.00:00 160.114583 373 700 905
        13-FEB-2004.00:00 149.020833 369 700 853
        14-FEB-2004.00:00 19.802083 30 700 109
        15-FEB-2004.00:00 16.932584 25 700 99
        16-FEB-2004.00:00 162.302083 538 700 977
        17-FEB-2004.00:00 157.322917 369 700 875
        18-FEB-2004.00:00 159.28125 381 700 892
        19-FEB-2004.00:00 162.458333 386 700 886
        20-FEB-2004.00:00 149.625 388 700 825
        21-FEB-2004.00:00 19.5 30 700 105
        22-FEB-2004.00:00 16.555556 31 700 74
        23-FEB-2004.00:00 163.479167 461 700 983
        24-FEB-2004.00:00 156.208333 356 700 871
        25-FEB-2004.00:00 158.791667 409 700 871
        26-FEB-2004.00:00 158.135417 377 700 905
        27-FEB-2004.00:00 150.395833 365 700 852
        28-FEB-2004.00:00 24.3125 38 700 124
        29-FEB-2004.00:00 21.044444 37 700 96
        01-MAR-2004.00:00 164.721649 409 700 951
        02-MAR-2004.00:00 160.073684 379 700 910
        03-MAR-2004.00:00 161.270833 377 700 876
        04-MAR-2004.00:00 160.916667 378 700 889
        05-MAR-2004.00:00 146.46875 368 700 824
        06-MAR-2004.00:00 18.208333 30 700 106
        07-MAR-2004.00:00 15.707865 37 700 88
        08-MAR-2004.00:00 157.8125 389 700 921
        09-MAR-2004.00:00 159.84375 427 700 896
        10-MAR-2004.00:00 157.802083 367 700 887
        11-MAR-2004.00:00 155.21875 368 700 863
        12-MAR-2004.00:00 146.875 352 700 855
        13-MAR-2004.00:00 14.072917 27 700 65
        14-MAR-2004.00:00 13.2 22 700 67
        15-MAR-2004.00:00 162.44898 432 700 934
        16-MAR-2004.00:00 159.90625 386 700 889
        17-MAR-2004.00:00 166.8125 391 700 907
        18-MAR-2004.00:00 161.020833 387 700 907
        19-MAR-2004.00:00 147.28125 359 700 872
        20-MAR-2004.00:00 22.0625 34 700 108
        21-MAR-2004.00:00 17.066667 29 700 83
        22-MAR-2004.00:00 161.552083 401 700 980
        23-MAR-2004.00:00 162.635417 405 700 896
        24-MAR-2004.00:00 158.5625 379 700 909
        25-MAR-2004.00:00 155.59375 384 700 891
        26-MAR-2004.00:00 141 350 700 829
        27-MAR-2004.00:00 22.125 38 700 108
        28-MAR-2004.00:00 16.94186 30 700 85
        29-MAR-2004.00:00 156.041667 386 700 952
        30-MAR-2004.00:00 157.145833 367 700 886
        30-MAR-2005.00:00

        Visit our website at http://www.ubs.com

        This message contains confidential information and is intended only
        for the individual named. If you are not the named addressee you
        should not disseminate, distribute or copy this e-mail. Please
        notify the sender immediately by e-mail if you have received this
        e-mail by mistake and delete this e-mail from your system.

        E-mail transmission cannot be guaranteed to be secure or error-free
        as information could be intercepted, corrupted, lost, destroyed,
        arrive late or incomplete, or contain viruses. The sender therefore
        does not accept liability for any errors or omissions in the contents
        of this message which arise as a result of e-mail transmission. If
        verification is required please request a hard-copy version. This
        message is provided for informational purposes and should not be
        construed as a solicitation or offer to buy or sell any securities or
        related financial instruments.
      • Stephen C. Grubb
        ... Jamie, I m still going to see what s going on with autorange and omitweekends thanks for letting me know about the issue Steve Stephen C. Grubb
        Message 3 of 11 , Apr 2 5:31 AM
        • 0 Attachment
          On Thu, 1 Apr 2004 jamie.echlin@... wrote:

          > I did this with oracle in the end, also changed the SQL templates to
          > omitweekends so am no longer bothered about that scaling issue I
          > reported earlier... thanks for listening anyway. jamie

          Jamie, I'm still going to see what's going on with autorange and
          omitweekends

          thanks for letting me know about the issue

          Steve


          Stephen C. Grubb scg@...
          Scientific Software Engineer, The Jackson Laboratory
          600 Main Street Bar Harbor, Maine 04609 USA
        • seancrotty
          I didn t see a proper response to the question posed a few weeks ago (below). I, too, am using the REGRESSION_LINE variable value for prediction. My equation
          Message 4 of 11 , May 11, 2004
          • 0 Attachment
            I didn't see a proper response to the question posed a few weeks ago
            (below).

            I, too, am using the REGRESSION_LINE variable value for prediction. My
            equation comes back as Y = -59072 + 6.12X. When Y=0, I happen to be at
            the origin which is the date "June 2003". Solving the equation, I see
            that: June 2003 = X = 9652.29.

            Hitting a couple other points on the graph, I think I've determined
            that X is probably in units of DAYS. However, if that's the case, the
            clock started in 1976 [ 2003 - (9652/365) ].

            That seems like an odd place to start the clock.

            Can someone tell be how numerical values of X map to dates? I'd like
            to be able to use the REGRESSION_LINE equation to annotate to location
            the regression line crosses another lineplot. Without knowing what
            9652.29 (for example) means in the date world, I'm out of luck. I'd
            love to be able to plug the solved x-value into a UNIX time converter
            for annotative purposes.

            For example, if the "clock" for Ploticus truly started on Jan 1, 1976.
            And the units of X are in days. I could convert X to UNIX time by:

            99,216,000 // six years of seconds to account for difference in
            UNIX clock and Ploticus clock
            + (((( X * 365 ) * 24 ) * 60 ) * 60 ) // X * days in year * hours in
            day * minutes in hour * seconds in minute

            There must be a straight-forward answer to this question.

            Thanks!
            Sean



            --- In ploticus@yahoogroups.com, <jamie.echlin@u...> wrote:
            > Hi,
            >
            > I am doing a linear regression where the x axis is dates.
            >
            > The @REGRESSION_LINE is
            > Y = -728 + 0.154X
            >
            > however when X is a date how do you specify that, is it days since a
            certain year or something?
            >
            > I put in a suitable value for Y and solved for X and came up with
            1985 or something.
            >
            > Help!
            >
            > jamie
            >
          • seancrotty
            I think I ll partially answer my own question: 1. The Ploticus clock started on Jan. 1, 1977 2. X values are in days With this, an X value can be mapped to
            Message 5 of 11 , May 11, 2004
            • 0 Attachment
              I think I'll partially answer my own question:

              1. The Ploticus clock started on Jan. 1, 1977
              2. X values are in days

              With this, an X value can be mapped to UNIX time via:

              ( X * 86,400 ) + 220,752,000

              However, I would love confirmation of my assertion.

              Thanks,
              Sean


              --- In ploticus@yahoogroups.com, "seancrotty" <seancrotty@y...> wrote:
              > I didn't see a proper response to the question posed a few weeks ago
              > (below).
              >
              > I, too, am using the REGRESSION_LINE variable value for prediction. My
              > equation comes back as Y = -59072 + 6.12X. When Y=0, I happen to be at
              > the origin which is the date "June 2003". Solving the equation, I see
              > that: June 2003 = X = 9652.29.
              >
              > Hitting a couple other points on the graph, I think I've determined
              > that X is probably in units of DAYS. However, if that's the case, the
              > clock started in 1976 [ 2003 - (9652/365) ].
              >
              > That seems like an odd place to start the clock.
              >
              > Can someone tell be how numerical values of X map to dates? I'd like
              > to be able to use the REGRESSION_LINE equation to annotate to location
              > the regression line crosses another lineplot. Without knowing what
              > 9652.29 (for example) means in the date world, I'm out of luck. I'd
              > love to be able to plug the solved x-value into a UNIX time converter
              > for annotative purposes.
              >
              > For example, if the "clock" for Ploticus truly started on Jan 1, 1976.
              > And the units of X are in days. I could convert X to UNIX time by:
              >
              > 99,216,000 // six years of seconds to account for difference in
              > UNIX clock and Ploticus clock
              > + (((( X * 365 ) * 24 ) * 60 ) * 60 ) // X * days in year * hours in
              > day * minutes in hour * seconds in minute
              >
              > There must be a straight-forward answer to this question.
              >
              > Thanks!
              > Sean
              >
              >
              >
              > --- In ploticus@yahoogroups.com, <jamie.echlin@u...> wrote:
              > > Hi,
              > >
              > > I am doing a linear regression where the x axis is dates.
              > >
              > > The @REGRESSION_LINE is
              > > Y = -728 + 0.154X
              > >
              > > however when X is a date how do you specify that, is it days since a
              > certain year or something?
              > >
              > > I put in a suitable value for Y and solved for X and came up with
              > 1985 or something.
              > >
              > > Help!
              > >
              > > jamie
              > >
            • Stephen C. Grubb
              ... This is correct. It ended up this way for historical reasons. Those with access to source code should be able to use any desired base year by changing the
              Message 6 of 11 , May 11, 2004
              • 0 Attachment
                On Tue, 11 May 2004, seancrotty wrote:

                > I think I'll partially answer my own question:
                >
                > 1. The Ploticus clock started on Jan. 1, 1977
                > 2. X values are in days

                This is correct. It ended up this way for historical reasons.

                Those with access to source code should be able to use any desired base
                year by changing the #define REFYEAR line in dates.c

                Steve

                >
                > With this, an X value can be mapped to UNIX time via:
                >
                > ( X * 86,400 ) + 220,752,000
                >
                > However, I would love confirmation of my assertion.
                >
                > Thanks,
                > Sean
                >
                >
                > --- In ploticus@yahoogroups.com, "seancrotty" <seancrotty@y...> wrote:
                > > I didn't see a proper response to the question posed a few weeks ago
                > > (below).
                > >
                > > I, too, am using the REGRESSION_LINE variable value for prediction. My
                > > equation comes back as Y = -59072 + 6.12X. When Y=0, I happen to be at
                > > the origin which is the date "June 2003". Solving the equation, I see
                > > that: June 2003 = X = 9652.29.
                > >
                > > Hitting a couple other points on the graph, I think I've determined
                > > that X is probably in units of DAYS. However, if that's the case, the
                > > clock started in 1976 [ 2003 - (9652/365) ].
                > >
                > > That seems like an odd place to start the clock.
                > >
                > > Can someone tell be how numerical values of X map to dates? I'd like
                > > to be able to use the REGRESSION_LINE equation to annotate to location
                > > the regression line crosses another lineplot. Without knowing what
                > > 9652.29 (for example) means in the date world, I'm out of luck. I'd
                > > love to be able to plug the solved x-value into a UNIX time converter
                > > for annotative purposes.
                > >
                > > For example, if the "clock" for Ploticus truly started on Jan 1, 1976.
                > > And the units of X are in days. I could convert X to UNIX time by:
                > >
                > > 99,216,000 // six years of seconds to account for difference in
                > > UNIX clock and Ploticus clock
                > > + (((( X * 365 ) * 24 ) * 60 ) * 60 ) // X * days in year * hours in
                > > day * minutes in hour * seconds in minute
                > >
                > > There must be a straight-forward answer to this question.
                > >
                > > Thanks!
                > > Sean
                > >
                > >
                > >
                > > --- In ploticus@yahoogroups.com, <jamie.echlin@u...> wrote:
                > > > Hi,
                > > >
                > > > I am doing a linear regression where the x axis is dates.
                > > >
                > > > The @REGRESSION_LINE is
                > > > Y = -728 + 0.154X
                > > >
                > > > however when X is a date how do you specify that, is it days since a
                > > certain year or something?
                > > >
                > > > I put in a suitable value for Y and solved for X and came up with
                > > 1985 or something.
                > > >
                > > > Help!
                > > >
                > > > jamie
                > > >
                >
                >
                >
                >
                > Yahoo! Groups Links
                >
                >
                >
                >
                >
                >


                Stephen C. Grubb scg@...
                Scientific Software Engineer, The Jackson Laboratory
                600 Main Street Bar Harbor, Maine 04609 USA
              • seancrotty
                Thanks, Steve. Is there any function that will take a Ploticus-numeric-date (for example, 9652.294...) and convert it into a string representation of that date
                Message 7 of 11 , May 11, 2004
                • 0 Attachment
                  Thanks, Steve.

                  Is there any function that will take a Ploticus-numeric-date (for
                  example, 9652.294...) and convert it into a string representation of
                  that date for annotative use? Or would I need to do that conversion
                  manually with system routines?

                  Thanks again,
                  Sean

                  --- In ploticus@yahoogroups.com, "Stephen C. Grubb" <scg@j...> wrote:
                  >
                  >
                  > On Tue, 11 May 2004, seancrotty wrote:
                  >
                  > > I think I'll partially answer my own question:
                  > >
                  > > 1. The Ploticus clock started on Jan. 1, 1977
                  > > 2. X values are in days
                  >
                  > This is correct. It ended up this way for historical reasons.
                  >
                  > Those with access to source code should be able to use any desired base
                  > year by changing the #define REFYEAR line in dates.c
                  >
                  > Steve
                  >
                  > >
                  > > With this, an X value can be mapped to UNIX time via:
                  > >
                  > > ( X * 86,400 ) + 220,752,000
                  > >
                  > > However, I would love confirmation of my assertion.
                  > >
                  > > Thanks,
                  > > Sean
                  > >
                  > >
                  > > --- In ploticus@yahoogroups.com, "seancrotty" <seancrotty@y...> wrote:
                  > > > I didn't see a proper response to the question posed a few weeks ago
                  > > > (below).
                  > > >
                  > > > I, too, am using the REGRESSION_LINE variable value for
                  prediction. My
                  > > > equation comes back as Y = -59072 + 6.12X. When Y=0, I happen to
                  be at
                  > > > the origin which is the date "June 2003". Solving the equation,
                  I see
                  > > > that: June 2003 = X = 9652.29.
                  > > >
                  > > > Hitting a couple other points on the graph, I think I've determined
                  > > > that X is probably in units of DAYS. However, if that's the
                  case, the
                  > > > clock started in 1976 [ 2003 - (9652/365) ].
                  > > >
                  > > > That seems like an odd place to start the clock.
                  > > >
                  > > > Can someone tell be how numerical values of X map to dates? I'd like
                  > > > to be able to use the REGRESSION_LINE equation to annotate to
                  location
                  > > > the regression line crosses another lineplot. Without knowing what
                  > > > 9652.29 (for example) means in the date world, I'm out of luck. I'd
                  > > > love to be able to plug the solved x-value into a UNIX time
                  converter
                  > > > for annotative purposes.
                  > > >
                  > > > For example, if the "clock" for Ploticus truly started on Jan 1,
                  1976.
                  > > > And the units of X are in days. I could convert X to UNIX time by:
                  > > >
                  > > > 99,216,000 // six years of seconds to account for difference in
                  > > > UNIX clock and Ploticus clock
                  > > > + (((( X * 365 ) * 24 ) * 60 ) * 60 ) // X * days in year *
                  hours in
                  > > > day * minutes in hour * seconds in minute
                  > > >
                  > > > There must be a straight-forward answer to this question.
                  > > >
                  > > > Thanks!
                  > > > Sean
                  > > >
                  > > >
                  > > >
                  > > > --- In ploticus@yahoogroups.com, <jamie.echlin@u...> wrote:
                  > > > > Hi,
                  > > > >
                  > > > > I am doing a linear regression where the x axis is dates.
                  > > > >
                  > > > > The @REGRESSION_LINE is
                  > > > > Y = -728 + 0.154X
                  > > > >
                  > > > > however when X is a date how do you specify that, is it days
                  since a
                  > > > certain year or something?
                  > > > >
                  > > > > I put in a suitable value for Y and solved for X and came up with
                  > > > 1985 or something.
                  > > > >
                  > > > > Help!
                  > > > >
                  > > > > jamie
                  > > > >
                  > >
                  > >
                  > >
                  > >
                  > > Yahoo! Groups Links
                  > >
                  > >
                  > >
                  > >
                  > >
                  > >
                  >
                  >
                  > Stephen C. Grubb scg@j...
                  > Scientific Software Engineer, The Jackson Laboratory
                  > 600 Main Street Bar Harbor, Maine 04609 USA
                • Stephen C. Grubb
                  Yes, $jultodate(), which would be used like this: #call $setdatefmt( dd-MMM-yyyy ) #set J = $jultodate( 9652.294 ) ...... J would then contain 06-JUN-2003 The
                  Message 8 of 11 , May 11, 2004
                  • 0 Attachment
                    Yes, $jultodate(), which would be used like this:

                    #call $setdatefmt( dd-MMM-yyyy )
                    #set J = $jultodate( 9652.294 )

                    ...... J would then contain 06-JUN-2003

                    The time portion will be dropped.. as far as I know there's no function
                    that converts to date & time string. -Steve


                    On Tue, 11 May 2004, seancrotty wrote:

                    > Thanks, Steve.
                    >
                    > Is there any function that will take a Ploticus-numeric-date (for
                    > example, 9652.294...) and convert it into a string representation of
                    > that date for annotative use? Or would I need to do that conversion
                    > manually with system routines?
                    >
                    > Thanks again,
                    > Sean
                    >
                    > --- In ploticus@yahoogroups.com, "Stephen C. Grubb" <scg@j...> wrote:
                    > >
                    > >
                    > > On Tue, 11 May 2004, seancrotty wrote:
                    > >
                    > > > I think I'll partially answer my own question:
                    > > >
                    > > > 1. The Ploticus clock started on Jan. 1, 1977
                    > > > 2. X values are in days
                    > >
                    > > This is correct. It ended up this way for historical reasons.
                    > >
                    > > Those with access to source code should be able to use any desired base
                    > > year by changing the #define REFYEAR line in dates.c
                    > >
                    > > Steve
                    > >
                    > > >
                    > > > With this, an X value can be mapped to UNIX time via:
                    > > >
                    > > > ( X * 86,400 ) + 220,752,000
                    > > >
                    > > > However, I would love confirmation of my assertion.
                    > > >
                    > > > Thanks,
                    > > > Sean
                    > > >
                    > > >
                    > > > --- In ploticus@yahoogroups.com, "seancrotty" <seancrotty@y...> wrote:
                    > > > > I didn't see a proper response to the question posed a few weeks ago
                    > > > > (below).
                    > > > >
                    > > > > I, too, am using the REGRESSION_LINE variable value for
                    > prediction. My
                    > > > > equation comes back as Y = -59072 + 6.12X. When Y=0, I happen to
                    > be at
                    > > > > the origin which is the date "June 2003". Solving the equation,
                    > I see
                    > > > > that: June 2003 = X = 9652.29.
                    > > > >
                    > > > > Hitting a couple other points on the graph, I think I've determined
                    > > > > that X is probably in units of DAYS. However, if that's the
                    > case, the
                    > > > > clock started in 1976 [ 2003 - (9652/365) ].
                    > > > >
                    > > > > That seems like an odd place to start the clock.
                    > > > >
                    > > > > Can someone tell be how numerical values of X map to dates? I'd like
                    > > > > to be able to use the REGRESSION_LINE equation to annotate to
                    > location
                    > > > > the regression line crosses another lineplot. Without knowing what
                    > > > > 9652.29 (for example) means in the date world, I'm out of luck. I'd
                    > > > > love to be able to plug the solved x-value into a UNIX time
                    > converter
                    > > > > for annotative purposes.
                    > > > >
                    > > > > For example, if the "clock" for Ploticus truly started on Jan 1,
                    > 1976.
                    > > > > And the units of X are in days. I could convert X to UNIX time by:
                    > > > >
                    > > > > 99,216,000 // six years of seconds to account for difference in
                    > > > > UNIX clock and Ploticus clock
                    > > > > + (((( X * 365 ) * 24 ) * 60 ) * 60 ) // X * days in year *
                    > hours in
                    > > > > day * minutes in hour * seconds in minute
                    > > > >
                    > > > > There must be a straight-forward answer to this question.
                    > > > >
                    > > > > Thanks!
                    > > > > Sean
                    > > > >
                    > > > >
                    > > > >
                    > > > > --- In ploticus@yahoogroups.com, <jamie.echlin@u...> wrote:
                    > > > > > Hi,
                    > > > > >
                    > > > > > I am doing a linear regression where the x axis is dates.
                    > > > > >
                    > > > > > The @REGRESSION_LINE is
                    > > > > > Y = -728 + 0.154X
                    > > > > >
                    > > > > > however when X is a date how do you specify that, is it days
                    > since a
                    > > > > certain year or something?
                    > > > > >
                    > > > > > I put in a suitable value for Y and solved for X and came up with
                    > > > > 1985 or something.
                    > > > > >
                    > > > > > Help!
                    > > > > >
                    > > > > > jamie
                    > > > > >
                    > > >
                    > > >
                    > > >
                    > > >
                    > > > Yahoo! Groups Links
                    > > >
                    > > >
                    > > >
                    > > >
                    > > >
                    > > >
                    > >
                    > >
                    > > Stephen C. Grubb scg@j...
                    > > Scientific Software Engineer, The Jackson Laboratory
                    > > 600 Main Street Bar Harbor, Maine 04609 USA
                    >
                    >
                    >
                    >
                    >
                    > Yahoo! Groups Links
                    >
                    >
                    >
                    >
                    >
                    >


                    Stephen C. Grubb scg@...
                    Scientific Software Engineer, The Jackson Laboratory
                    600 Main Street Bar Harbor, Maine 04609 USA
                  • seancrotty
                    Awesome. I saw $jultodate() in the docs but misunderstood its use. Thank you, Sean ... desired base ... weeks ago ... determined ... I d like ... knowing what
                    Message 9 of 11 , May 11, 2004
                    • 0 Attachment
                      Awesome. I saw $jultodate() in the docs but misunderstood its use.

                      Thank you,
                      Sean

                      --- In ploticus@yahoogroups.com, "Stephen C. Grubb" <scg@j...> wrote:
                      > Yes, $jultodate(), which would be used like this:
                      >
                      > #call $setdatefmt( dd-MMM-yyyy )
                      > #set J = $jultodate( 9652.294 )
                      >
                      > ...... J would then contain 06-JUN-2003
                      >
                      > The time portion will be dropped.. as far as I know there's no function
                      > that converts to date & time string. -Steve
                      >
                      >
                      > On Tue, 11 May 2004, seancrotty wrote:
                      >
                      > > Thanks, Steve.
                      > >
                      > > Is there any function that will take a Ploticus-numeric-date (for
                      > > example, 9652.294...) and convert it into a string representation of
                      > > that date for annotative use? Or would I need to do that conversion
                      > > manually with system routines?
                      > >
                      > > Thanks again,
                      > > Sean
                      > >
                      > > --- In ploticus@yahoogroups.com, "Stephen C. Grubb" <scg@j...> wrote:
                      > > >
                      > > >
                      > > > On Tue, 11 May 2004, seancrotty wrote:
                      > > >
                      > > > > I think I'll partially answer my own question:
                      > > > >
                      > > > > 1. The Ploticus clock started on Jan. 1, 1977
                      > > > > 2. X values are in days
                      > > >
                      > > > This is correct. It ended up this way for historical reasons.
                      > > >
                      > > > Those with access to source code should be able to use any
                      desired base
                      > > > year by changing the #define REFYEAR line in dates.c
                      > > >
                      > > > Steve
                      > > >
                      > > > >
                      > > > > With this, an X value can be mapped to UNIX time via:
                      > > > >
                      > > > > ( X * 86,400 ) + 220,752,000
                      > > > >
                      > > > > However, I would love confirmation of my assertion.
                      > > > >
                      > > > > Thanks,
                      > > > > Sean
                      > > > >
                      > > > >
                      > > > > --- In ploticus@yahoogroups.com, "seancrotty"
                      <seancrotty@y...> wrote:
                      > > > > > I didn't see a proper response to the question posed a few
                      weeks ago
                      > > > > > (below).
                      > > > > >
                      > > > > > I, too, am using the REGRESSION_LINE variable value for
                      > > prediction. My
                      > > > > > equation comes back as Y = -59072 + 6.12X. When Y=0, I happen to
                      > > be at
                      > > > > > the origin which is the date "June 2003". Solving the equation,
                      > > I see
                      > > > > > that: June 2003 = X = 9652.29.
                      > > > > >
                      > > > > > Hitting a couple other points on the graph, I think I've
                      determined
                      > > > > > that X is probably in units of DAYS. However, if that's the
                      > > case, the
                      > > > > > clock started in 1976 [ 2003 - (9652/365) ].
                      > > > > >
                      > > > > > That seems like an odd place to start the clock.
                      > > > > >
                      > > > > > Can someone tell be how numerical values of X map to dates?
                      I'd like
                      > > > > > to be able to use the REGRESSION_LINE equation to annotate to
                      > > location
                      > > > > > the regression line crosses another lineplot. Without
                      knowing what
                      > > > > > 9652.29 (for example) means in the date world, I'm out of
                      luck. I'd
                      > > > > > love to be able to plug the solved x-value into a UNIX time
                      > > converter
                      > > > > > for annotative purposes.
                      > > > > >
                      > > > > > For example, if the "clock" for Ploticus truly started on Jan 1,
                      > > 1976.
                      > > > > > And the units of X are in days. I could convert X to UNIX
                      time by:
                      > > > > >
                      > > > > > 99,216,000 // six years of seconds to account for
                      difference in
                      > > > > > UNIX clock and Ploticus clock
                      > > > > > + (((( X * 365 ) * 24 ) * 60 ) * 60 ) // X * days in year *
                      > > hours in
                      > > > > > day * minutes in hour * seconds in minute
                      > > > > >
                      > > > > > There must be a straight-forward answer to this question.
                      > > > > >
                      > > > > > Thanks!
                      > > > > > Sean
                      > > > > >
                      > > > > >
                      > > > > >
                      > > > > > --- In ploticus@yahoogroups.com, <jamie.echlin@u...> wrote:
                      > > > > > > Hi,
                      > > > > > >
                      > > > > > > I am doing a linear regression where the x axis is dates.
                      > > > > > >
                      > > > > > > The @REGRESSION_LINE is
                      > > > > > > Y = -728 + 0.154X
                      > > > > > >
                      > > > > > > however when X is a date how do you specify that, is it days
                      > > since a
                      > > > > > certain year or something?
                      > > > > > >
                      > > > > > > I put in a suitable value for Y and solved for X and came
                      up with
                      > > > > > 1985 or something.
                      > > > > > >
                      > > > > > > Help!
                      > > > > > >
                      > > > > > > jamie
                      > > > > > >
                      > > > >
                      > > > >
                      > > > >
                      > > > >
                      > > > > Yahoo! Groups Links
                      > > > >
                      > > > >
                      > > > >
                      > > > >
                      > > > >
                      > > > >
                      > > >
                      > > >
                      > > > Stephen C. Grubb scg@j...
                      > > > Scientific Software Engineer, The Jackson Laboratory
                      > > > 600 Main Street Bar Harbor, Maine 04609 USA
                      > >
                      > >
                      > >
                      > >
                      > >
                      > > Yahoo! Groups Links
                      > >
                      > >
                      > >
                      > >
                      > >
                      > >
                      >
                      >
                      > Stephen C. Grubb scg@j...
                      > Scientific Software Engineer, The Jackson Laboratory
                      > 600 Main Street Bar Harbor, Maine 04609 USA
                    Your message has been successfully submitted and would be delivered to recipients shortly.