models_linear {bioset}R Documentation

Linear model functions.

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

fit_linear(x, y)

plot_linear(x, y)

interpolate_linear(y, model)

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

# 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)


[Package bioset version 0.2.3 Index]