Ordinary_Least_Squares: Estimate prediction band or prediction intervals using...

View source: R/Ordinary_Least_Squares.R

Ordinary_Least_SquaresR Documentation

Estimate prediction band or prediction intervals using ordinary least squares regression

Description

Estimate prediction band or prediction intervals using ordinary least squares regression

Usage

Ordinary_Least_Squares(
  data,
  level = 0.99,
  R = 3,
  Np = 1000,
  evaluated_materials = NULL,
  optimize_for_measurement_errors = TRUE
)

Arguments

data

A data frame or data table with format LFDT enclosed with all replicated measurements

level

A numeric value that captures the overall confidence level of the estimated prediction band. This is assumed to already be Bonferroni-corrected. The recommended base level is 0.99

R

An integer signifying the maximum number of replicated measurements performed on each evaluated material. This will shrink the width of the prediction interval and band because using the mean of replicates decreases uncertainty

Np

An integer, which captures the number of pointwise prediction intervals making the prediction band across the concentration range. Ignored if evaluated_materials is not NULL

evaluated_materials

A data frame or data table with format LFDT enclosed with all replicated measurements for evaluated materials such as EQAMs or CRMs. Should be NULL if the PB, that is, pointwise prediction intervals to be estimated

optimize_for_measurement_errors

Logical - Should we shift axis if the measurement error for MP_B is larger than MP_A? This will be optimal because OLS assumes that variability in MP_B is zero

Value

A data table enclosed with information regarding the estimated prediction band across the concentration range or for the particular evaluated materials

Examples

Ordinary_Least_Squares(data = sdwinsp(R = 5)[,Comparison:="NO"], level = 0.90, R = 5, evaluated_materials = NULL)

pernille267/commutability.selectivity documentation built on July 20, 2022, 9:11 a.m.