sclr {sclr} | R Documentation |
Fits the scaled logit model
Description
Used to fit the scaled logit model from Dunning (2006).
Usage
sclr(
formula,
data = NULL,
ci_lvl = 0.95,
tol = 10^(-7),
algorithm = c("newton-raphson", "gradient-ascent"),
nr_iter = 2000,
ga_iter = 2000,
n_conv = 3,
conventional_names = FALSE,
seed = NULL
)
Arguments
formula |
an object of class "formula": a symbolic description of the model to be fitted. |
data |
a data frame. |
ci_lvl |
Confidence interval level for the parameter estimates. |
tol |
Tolerance. |
algorithm |
Algorithms to run. "newton-raphson" or "gradient-ascent". If a character vector, the algorithms will be applied in the order they are present in the vector. |
nr_iter |
Maximum allowed iterations for Newton-Raphson. |
ga_iter |
Maximum allowed iterations for gradient ascent. |
n_conv |
Number of times the algorithm has to converge (to work around local maxima). |
conventional_names |
If |
seed |
Seed for the algorithms. |
Details
The model is logistic regression with an added parameter for the top
asymptote. That parameter is reported as theta
(or (Baseline)
if conventional_names = TRUE
). Note that it is reported on the logit
scale. See vignette("sclr-math")
for model specification,
log-likelihood, scores and second derivatives. The main default optimisation
algorithm is Newton-Raphson. Gradient ascent is used as a fallback by
default. Computing engine behind the fitting is sclr_fit
.
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. |
algorithm |
Algorithm used. |
algorithm_return |
Everything the algorithm returned. |
n_converge |
The number of Newton-Raphson iterations (including resets) that were required for convergence. |
x |
Model matrix derived from |
y |
Response matrix derived from |
call |
The original call to |
model |
Model frame object derived from |
terms |
Terms object derived from model frame. |
ci |
Confidence intervals of the parameter estimates. |
log_likelihood |
Value of log-likelihood calculated at the ML estimates of parameters. |
formula |
Passed formula. |
data |
Passed data. |
Methods supported: print
,
vcov
, coef
,
model.frame
,
model.matrix
,
summary
, predict
,
tidy
(broom
package),
logLik
.
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
library(sclr)
fit1 <- sclr(status ~ logHI, one_titre_data)
summary(fit1)