powered by
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)
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
- sequence of times
- corresponding sequence of values
- minimum time to include (NULL)
NULL
- maximum time to include (NULL)
x = c(0:100) y = exp(-.1*x) th = calculate_halflife(times=x, values=y) thalf = th$thalf
Run the code above in your browser using DataLab