Package 'lin.eval'

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

Help Index


Computes average deviation from linearity adl.

Description

Computes average deviation from linearity adl.

Usage

calculate_adl(predicted.poly, predicted.lm)

Arguments

predicted.poly

vector of predicted values from best-fitting polynomial model

predicted.lm

vector of predicted values from linear model

Value

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.

Description

Establishes if relationship between two vectors is linear or nonlinear. Does not return any value. Prints details of the relationship between x and y.

Usage

poly_eval(y, x, threshold)

Arguments

y

vector of response values

x

vector of predictor values

threshold

optional argument. Threshold percentage value for average deviation from linearity. Defaults to 5.

Examples

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)