| Title: | Perform Polynomial Evaluation of Linearity |
|---|---|
| Description: | Evaluates whether the relationship between two vectors is linear or nonlinear. Performs a test to determine how well a linear model fits the data compared to higher order polynomial models. Jhang et al. (2004) <doi:10.1043/1543-2165(2004)128%3C44:EOLITC%3E2.0.CO;2>. |
| Authors: | Vishesh Shrivastav |
| Maintainer: | Vishesh Shrivastav <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.2 |
| Built: | 2026-05-23 06:22:55 UTC |
| Source: | https://github.com/vishesh-shrivastav/lin.eval |
Computes average deviation from linearity adl.
calculate_adl(predicted.poly, predicted.lm)calculate_adl(predicted.poly, predicted.lm)
predicted.poly |
vector of predicted values from best-fitting polynomial model |
predicted.lm |
vector of predicted values from linear model |
value for average deviation from linearity as a percentage
Establishes if relationship between two vectors is linear or nonlinear. Does not return any value. Prints details of the relationship between x and y.
poly_eval(y, x, threshold)poly_eval(y, x, threshold)
y |
vector of response values |
x |
vector of predictor values |
threshold |
optional argument. Threshold percentage value for average deviation from linearity. Defaults to 5. |
foo <- c(1000, 4000, 5000, 4500, 3000, 4000, 9000, 11000, 15000, 12000, 7000, 3000) bar <- c(9914, 40487, 54324, 50044, 34719, 42551, 94871, 118914, 158484, 131348, 78504, 36284) poly_eval(bar, foo)foo <- c(1000, 4000, 5000, 4500, 3000, 4000, 9000, 11000, 15000, 12000, 7000, 3000) bar <- c(9914, 40487, 54324, 50044, 34719, 42551, 94871, 118914, 158484, 131348, 78504, 36284) poly_eval(bar, foo)