Calculating half-life

DataGraph Forums General Getting Started Calculating half-life

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #8349
    pharmpk
    Participant

      I’m sure I should be able to find this in the manual but I’m having trouble finding the answer.

      I have a set of data, one time column and three concentration data columns. The data fit well with an exponential function and DG provides Power as the slope. In my area of interest,,pharmacokinetics, the -slope is a rate constant and ln(2)/rate constant is the half-life. I’d like to turn the slope value into a half-life and use it in a text label on the graph. One value for half-life for each column of concentration data.

      I’ll keep looking in the help but any help would be appreciated.

      Thanks, David

      PS Congratulations on the new version 5.0 whichI’m using.

      #8350
      dgteam
      Moderator

        There are two ways you could approach this.

         

        First, if you add a token in a text command with a number from your fit, you can use that value in a function directly in the token.  Click the right side of the token to open the formatting options and click the top one, “Use function”.  Then you can add your equation, but note that we use the notation that the natural log is log(x). Base 10 is log10(x).

        use

        The other option is to extract the value from the command to an Expression variable.  Do the calculation in the Expression variable.  Then the output will be available to add as an token in a Text command.

        Does that help?

         

        #8351
        pharmpk
        Participant

          OK, I have an answer. Maybe not the best but seems to work

          I set the Fit function to arbitrary as a*exp(-b*x) with x = Time (column)

          The fit gave me values of a and b (= kel1). I then calculated Half-life1 as log(2)/kel1. The same for the next columns using kel2 and kel3

          Screen Shot 2022-02-23 at 1.41.57 PM

           

           

          #8436
          dgteam
          Moderator

            We thought this would be a good example to add in to DataGraph.  If you go now to File > On-line examples you’ll see an “Exponential Fit” example that shows how to calculate the half-life using a variable or in a token.   This uses Exponential option directly and you don’t have to use the Arbitrary fit.  Hopefully this is helpful.

            We also think having the half-life as an output from the command would make a lot of sense, as this is a common need.  So we are putting this on our To-do list 🙂

             

            Fomatted

            #8438
            pharmpk
            Participant

              Thanks for adding this example. I finally worked out how to use the exponential fit and Extract Power as kel1 and thus half-life by using an expression.

              I now have data which appears bi-exponential with

              y = a*exp(-b*x) + c*exp(-d*t)

              so I might be back to an arbitrary fit (using the logarithmic pop-up to the right of the equation field).

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

            DataGraph Forums General Getting Started Calculating half-life