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

View source: R/Ordinary_Least_Squares_over_groups.R

Ordinary_Least_Squares_over_groupsR Documentation

Estimate prediction band or prediction intervals using ordinary least squares regression over groups

Description

Estimate prediction band or prediction intervals using ordinary least squares regression over groups

Usage

Ordinary_Least_Squares_over_groups(
  data,
  groups = "Comparison",
  level = 0.99,
  R = 3,
  Np = 1000,
  evaluated_materials,
  optimize_for_measurement_errors = TRUE,
  column_order = c("reversed", "Comparison", "SampleID", "MP_B", "MP_A", "fit", "lwr",
    "upr")
)

Arguments

data

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

groups

The names of the grouping columns of data and evaluated_materials

level

A numeric value that captures the overall confidence level of the estimated prediction band

R

An integer signifying the maximum number of replicated measurements performed on each evaluated material

Np

An integer, which captures the number of pointwise prediction intervals making the prediction band across the concentration range. Not relevant if evaluated_materials are !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 axes 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

column_order

A vector specifying the order of the columns of the outputted grouped data table. Will be ignored if evaluated_materials is NULL. Note that the length of column_order must be the same as the number of columns of output columns, which is 6 + the number of grouping columns

Details

This function is not finished

Value

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

Examples

Ordinary_Least_Squares_over_groups(MS_wise(sampled_cs_measurements), level = 0.99, evaluated_materials = MS_wise(sampled_eqam_measurements))

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