Apply calibration

iso_apply_calibration(dt, predict, calibration = "",
  predict_range = NULL, calculate_error = FALSE,
  quiet = default(quiet))

Arguments

dt

nested data table with all_data and calibration columns (see iso_generate_calibration)

predict

which value to calculate, must be one of the regression's independent variables

calibration

name of the calibration to apply, must match the name used in iso_generate_calibration (if any)

predict_range

vector of 2 numbers, if provided will be used for finding the solution for the predict variable. By default uses the range observed in the calibration variables. Specifying the predict_range is usually only necessary if the calibration range should be extrapolated significantely.

calculate_error

whether to estimate the standard error from the calibration (using the Wald method), stores the result in the new predict_error column. Note that error calculation slows this function down a fair bit and is therefore disabled by default.

quiet

whether to display (quiet=FALSE) or silence (quiet = TRUE) information messages.

Value

the data table with the following columns added to the nested all_data \:

  • predict column with suffix _pred: the predicted value from applying the calibration

  • predict column with suffix _pred_se: the error of the predicated value propagated from the calibration. Only created if calculate_error = TRUE.

  • predict column with suffix _pred_in_range: reports whether a data entry is within the range of the calibration by checking whether ALL dependent and independent variables in the regression model are within the range of the calibration - is set to FALSE if any(!) of them are not - i.e. this column provides information on whether new values are extrapolated beyond a calibration model and treat the extrapolated ones with the appropriate care. Note that all missing predicted values (due to missing parameters) are also automatically flagged as not in range