Learn R Programming

blm (version 1.2)

logistic.rd: Estimate a risk difference between two subject types from a logistic regression model

Description

Point estimate and confidence interval for an absolute risk difference based on a logistic regression model of cohort binary data.

Usage

logistic.rd(type1,type2,fit,data,sig=4,fixed=FALSE,alpha=.05)

Arguments

type1
vector of covariate values for first probability estimate
type2
vector of covariate value for second probability estmate
fit
glm object for logistic regression
data
data frame on which the fit was based
sig
numeric number of significant digits for reported estimate
fixed
logical whether zero-valued quantities should be fixed
alpha
numeric value to specify the 100(1-alpha)% confidence interval for the risk difference

Value

  • For probability of type1 - probability of type2, returns a list of est, se, lower, upper and CI.

Details

If fixed is FALSE then the average over all covariates represented as zero in type1 and type2 is taken. If TRUE, these are fixed at zero and the risk difference applies only to the risk difference between individual who share a zero covriate pattern for these factors. Because of the nonlinearity of the logistic model on the probability scale, the risk difference is a function of all covariates of the model, so will change for different covariate patterns that are still equivalent between the types being compared.