models_linear: Linear model functions.

Description Usage Arguments Value See Also Examples

Description

Use these functions to calculate a linear model from data, plot the model and use it to calculate x-values from the model data and y-values (inverse function).

Those function are intended to be used in set_calc_concentrations / sets_read to be applied to the calibrators (fit_linear) and interpolate concentrations from the raw values (interpolate_linear). Use plot_linear to visually inspect goodness of fit.

Usage

1
2
3
4
5

Arguments

x

The x coordinates of the points.

y

The y coordinates of the points.

model

The line model.

Value

See Also

set_calc_concentrations, sets_read, models_lnln

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# generate data
x <- c(1, 3, 4, 7)
y_known <- c(3.5, 6.5, 8, 12.5)  # x is known for these values
y_unknown <- c(5, 9.5, 11)       # we will calculate x for those

model <- fit_linear(x = x, y = y_known)
model

plot_linear(x = x, y = y_known)

interpolate_linear(y = y_unknown, model)

rm(x, y_known, y_unknown, model)

randomchars42/bioset documentation built on May 7, 2019, 9:43 p.m.