get_STPD_factor: Get STPD correction factor

Description Usage Arguments Value Examples

View source: R/stpd.R

Description

This function predicts STPD correction factor using linear model with predictor variables: baro for barometric pressure and temp_c for temperature in celsius. The data that linear model was fitted can be found in a data frame btps_df.

Usage

1
2
3
4
5
6
7
get_STPD_factor(
  baro,
  temp_c,
  interval = c("none", "confidence", "prediction"),
  level = 0.95,
  ...
)

Arguments

baro

(Numeric) Barometric pressure (in mmHg) at the collection site.

temp_c

(Numeric) Temperature in celsius at the collection site.

interval

Type of interval calculation: "None" returns estimated STPD correction factor; "confidence" and "prediction" return confidence interval and prediction interval, respectively.

level

Tolerance/confidence level.

...

passed to predict.lm()

Value

A numeric vector (invisibly) or matrix (if interval = "confidence" or "prediction").

Examples

1
2
3
4
5
6
# Estimated STPD factor
get_STPD_factor(baro = 761, temp_c = 29)
get_STPD_factor(baro = 761:762, temp_c = 29:30) # Vectorized

# Estimated STPD factor value with confidence Interval
get_STPD_factor(baro = 761:762, temp_c = 29:30, interval = "c")

Lightbridge-KS/rslab documentation built on Feb. 24, 2022, 1:36 a.m.