bsw() fits a log-binomial model using a modified Newton-type algorithm (BSW algorithm) for solving the maximum likelihood estimation problem under linear inequality constraints.
bsw(formula, data, maxit = 200L, conswitch = 1)An object of S4 class "bsw" containing the following slots:
An object of class "call".
An object of class "formula".
A numeric vector containing the estimated model parameters.
A positive integer indicating the number of iterations.
A logical constant that indicates whether the model has converged.
A numerical vector containing the dependent variable of the model.
The model matrix.
A data frame containing the variables in the model.
An object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.
A data frame containing the variables in the model.
A positive integer giving the maximum number of iterations.
Specifies how the constraint matrix is constructed:
Generates all possible combinations of minimum and maximum values for the predictors (excluding the intercept), resulting in \(2^{m-1}\) constraints. This formulation constrains model predictions within the observed data range, making it suitable for both risk factor identification and prediction (prognosis).
Uses the raw design matrix x as the constraint matrix, resulting in \(n\) constraints.
This is primarily suitable for identifying risk factors, but not for prediction tasks, as predictions are not bounded to realistic ranges.
Adam Bekhit, Jakob Schöpe
Wagenpfeil S (1996) Dynamische Modelle zur Ereignisanalyse. Herbert Utz Verlag Wissenschaft, Munich, Germany
Wagenpfeil S (1991) Implementierung eines SQP-Verfahrens mit dem Algorithmus von Ritter und Best. Diplomarbeit, TUM, Munich, Germany
set.seed(123)
x <- rnorm(100, 50, 10)
y <- rbinom(100, 1, exp(-4 + x * 0.04))
fit <- bsw(formula = y ~ x, conswitch = 1, data = data.frame(y = y, x = x))
summary(fit)
Run the code above in your browser using DataLab