lbreg (version 1.3)

lbreg: Log-Binomial regression

Description

Fitting a Log-Binomial Regression Model

Usage

lbreg(formula, data, start.beta, tol=0.9999, delta=1, ...)

Arguments

formula

an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.

data

an optional data frame containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which lbreg is called.

start.beta

starting values for the parameters in the linear predictor. If missing, the default value explained in Andrade and Andrade (2018) is used according to the choice of delta.

tol

defaults to 0.9999; threshold for declaring a probability on the boundary (p = 1).

delta

defaults to 1. See reference below.

not used.

Value

Active

matrix of active constraints.

barrier.value

same as in constrOptim.

coefficients

named vector of estimated regression coefficients.

convergence

same as in constrOptim.

call

the matched call.

cook.distance

Cook's distance.

data

the data argument.

deviance

residual deviance.

dev.resid

deviance residuals.

fitted.values

fitted probabilities.

formula

the formula supplied.

hat.matrix

hat matrix for GLMs (whose diagonal contains leverage values).

loglik

maximized loglikelihood.

outer.iterations

same as in constrOptim.

residuals

Pearson residuals.

se

standard errors of estimated coefficients.

start.beta

starting values used by constrOptim.

vcov

variance-covariance matrix of estimates.

vcov0

inverse of observed Fisher information; should be equal to vcov if there are no active constraints (Active = NULL).

X2

sum of squared residuals (variance-inflation estimate (dispersion) = X2/df).

Details

This function uses constrOptim with the BFGS method in order to perform maximum likelihood estimation of the log-binomial regression model as described in the reference below. When the MLE is the interior of the parameter space results should agree with glm(...,family=binomial(link='log')). lbreg uses the adaptive logarithimic barrier algorithm rather than iteratively weighted least squares (glm).

References

Andrade, BB; Andrade JML (2018) Some results for Maximum Likelihood Estimation of Adjusted Relative Risks. Communications in Statistics - Theory and Methods.

See Also

glm (family=binomial(link='log')), relrisk

Examples

Run this code
# NOT RUN {
require(lbreg)

# data preparation
data(PCS)  # ungrouped data
w <- PCS
w <- w[,-1]
w$race <- factor(w$race)
w$dpros <- factor(w$dpros)
w$dcaps <- factor(w$dcaps)

# log-binomial regression
fm <- lbreg(tumor ~ ., data=w)
fm
coef(fm)
summary(fm)


# grouped data
require(lbreg)
data(Caesarian)
m1 <- lbreg( cbind(n1, n0) ~ RISK + NPLAN + ANTIB, data=Caesarian)
summary(m1)

# dispersion estimate based on deviance residuals
sum(m1$dev.res^2)  
# dispersion estimate based on Pearson residuals (reported in the summary above)
sum(m1$residuals^2)/(8-4)  

predict(m1, newdata=data.frame(RISK=0, NPLAN=1, ANTIB=1))

# m0 <- glm( cbind(n1, n0) ~ RISK + NPLAN + ANTIB, data=Dat, family=binomial(link='log'))
# summary(m0)


# }

Run the code above in your browser using DataCamp Workspace