find_prot_titre_val {sclr}R Documentation

Search function for scaled logit protection covariate levels

Description

The search engine behind get_protection_level. Should not usually be necessary to call this directly.

Usage

find_prot_titre_val(
  fit,
  var_name,
  newdata = NULL,
  prot_var_name = "prot_point",
  lvl = 0.5,
  ci_level = 0.95,
  tol = 10^(-7)
)

Arguments

fit

Object returned by sclr.

var_name

Name of the covariate for which the protection values should be calculated. This name should appear in the formula of the call to sclr which was used to generate fit.

newdata

A dataframe with all covariates except the one for which protection values should be calculated.

prot_var_name

A variable name among those returned by predict.sclr which needs to equal lvl at the value of var_name that is supposed to be found.

lvl

Protection level to find titre values for. Default is 0.5 (50%).

ci_level

Confidence level for the calculated interval. Default is 0.95.

tol

Tolerance. The values will be found numerically, once the algorithm converges within tol of lvl it stops looking. Default is 10^(-7).

Value

A dataframe. Will have the same variables as newdata with the addition of the var_name variable.


[Package sclr version 0.3.1 Index]