calculate_halflife function

Calculate the halflife of data

Calculate the halflife of data

Determines the terminal halflife of a sequence of corresponding times and values with optional minimum and maximum times to censor data.

calculate_halflife(times = NULL, values = NULL, tmin = NULL, tmax = NULL)

Arguments

  • times: - sequence of times
  • values: - corresponding sequence of values
  • tmin: - minimum time to include (NULL)
  • tmax: - maximum time to include (NULL)

Returns

List with the following names

  • thalf Halflife in units of times above
  • mod Result of lm used to fit the log transformed data
  • df Dataframe with the data and predicted values at the time within tmin and tmax

Examples

x = c(0:100) y = exp(-.1*x) th = calculate_halflife(times=x, values=y) thalf = th$thalf
  • Maintainer: John Harrold
  • License: BSD_2_clause + file LICENSE
  • Last published: 2025-01-07