lol: Upper Limit of Linearity (LOL)

View source: R/lol.r View source: R/ldr.R

lolR Documentation

Upper Limit of Linearity (LOL)

Description

Take lists of x and y, return the upper limit of linearity.

Usage

lol(x, y, rsq = "0.95", min_dils = 3, force_origin = FALSE)

Arguments

x

independent variable, e.g. concentration or dilution

y

dependent variable, e.g. into or intb

rsq

minimum R^2 at which signal is considered linear

min_dils

minimum number of unique x values (dilutions) that must be present for a compound

force_origin

Force regression through the origin? Set T for pre-blanked data, otherwise F.

Value

a named list: $y_max: maximum y for which R^2 >= rsq $n_dils: number of dilutions used in the linreg $rr: R^2 of the linreg # NTS: can put slope and intercept in here too, if need be

Examples

# use inside a dplyr::summarise() call
ldrs_roi <- areas_all %>%
  group_by(roi) %>%
  summarise(intb_max = lol(intb))


octopode/tidychrom documentation built on Nov. 2, 2022, 1:32 a.m.