derivative: Derivative of fitted polynomial

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Calculate derivative of polynomial for given x.

Usage

1
derivative(obj, x)

Arguments

obj

an object of class 'lm', fitted in y ~ x + I(x^2) + I(x^3) + ... way.

x

a vector of x values

Details

This function is called via the other high level functions, but it can be also called directly.

Value

A vector of calculated derivatives.

Author(s)

Lukasz Komsta

See Also

lm

Examples

1
2
3
4
x = 1:10
y = jitter(x+x^2)
fit = lm(y~x+I(x^2))
derivative(fit,1:10)

Example output

Loading required package: MASS
Loading required package: outliers
------------------------------------------
If you use this package, please cite the recent paper containing description of this software:
Komsta, L. Chemometric and statistical evaluation of calibration curves in pharmaceutical analysis 
           - a short review on trends and recommendations. J. AOAC Int. 2012, 95, 3, 669-672.
------------------------------------------
 [1]  2.835864  4.877039  6.918215  8.959390 11.000565 13.041740 15.082915
 [8] 17.124090 19.165265 21.206441

quantchem documentation built on May 30, 2017, 5:28 a.m.