Learn R Programming

blorr (version 0.3.2)

blr_regress: Binary logistic regression

Description

Binary logistic regression.

Usage

blr_regress(object, ...)

# S3 method for default blr_regress( object, data, odd_conf_limit = FALSE, weights = NULL, offset = NULL, ... )

# S3 method for glm blr_regress(object, odd_conf_limit = FALSE, ...)

Arguments

object

An object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted or class glm with binomial family and logit link. Weighted models (any prior weight other than 1) and grouped binomial models (cbind(successes, failures) or proportions) are not supported; refit models stored without their model frame or response using glm(..., model = TRUE, y = TRUE).

...

Other inputs.

data

A data.frame or tibble containing the variables in the model.

odd_conf_limit

If TRUE, odds ratio confidence limits will be displayed.

weights

An optional vector of prior weights to be used in the fitting process.

offset

An optional offset to be included in the model.

Details

The default method fits a binomial logit model with glm. An offset may be supplied directly, and the formula environment is kept. When a fitted glm object is supplied, the fit is summarised directly, so an offset supplied through the model formula and the formula environment are respected. Weighted models are rejected by the shared model guard.

Odds ratio confidence limits are profile-likelihood intervals computed by confint.

Examples

Run this code
# using formula
blr_regress(object = honcomp ~ female + read + science, data = hsb2)

# using a model built with glm
model <- glm(honcomp ~ female + read + science, data = hsb2,
             family = binomial(link = 'logit'))

blr_regress(model)

# odds ratio estimates
blr_regress(model, odd_conf_limit = TRUE)

Run the code above in your browser using DataLab