Learn R Programming

sclr (version 0.1.0)

sclr: Fits the scaled logit model

Description

Used to fit the scaled logit model from Dunning (2006).

Usage

sclr(formula, data, calc_ci = TRUE, ci_lvl = 0.95, calc_ll = TRUE,
  tol = 10^(-7), n_iter = NULL, max_tol_it = 10^4)

Arguments

formula

an object of class "formula": a symbolic description of the model to be fitted.

data

a data frame.

calc_ci

Whether to calculate confidence intervals.

ci_lvl

Confidence interval level for the parameter estimates.

calc_ll

Whether to calculate log likelihood at MLEs.

tol

Tolerance. Used when n_iter is NULL.

n_iter

Number of Newton-Raphson iterations. tol is ignored when this is not NULL.

max_tol_it

Maximum tolerated iterations. If it fails to converge within this number of iterations, will return with an error.

Value

An object of class sclr. This is a list with the following elements:

parameters

Maximum likelihood estimates of the parameter values.

covariance_mat

The variance-covariance matrix of the parameter estimates.

n_converge

The number of Newton-Raphson iterations (including resets) that were required for convergence.

confint

Confidence intervals of the parameter estimates.

x

Model matrix derived from formula and data.

y

Response matrix derived from formula and data.

log_likelihood

Value of log-likelihood calculated at the ML estimates of parameters.

call

The original call to sclr.

model

Model frame object derived from formula and data.

terms

Terms object derived from model frame.

Methods supported: print, vcov, coef, summary, predict, tidy (broom package).

Details

The model is of the form $$P(Y = 1) = \lambda(1 - logit^{-1}(\beta_0 + \beta_1X_1 + \beta_2X_2 + ... + \beta_kX_k))$$ Where \(Y\) is the binary outcome indicator, (eg. 1 - infected, 0 - not infected). \(X\) - covariate. \(k\) - number of covariates. Computing engine behind the fitting is sclr_fit.

References

Dunning AJ (2006). "A model for immunological correlates of protection." Statistics in Medicine, 25(9), 1485-1497. https://doi.org/10.1002/sim.2282.

Examples

Run this code
# NOT RUN {
library(sclr)
fit1 <- sclr(status ~ logHI, sclr_one_titre_data)
summary(fit1)

# }

Run the code above in your browser using DataLab