Learn R Programming

geepack (version 1.1-6)

relRisk: Fit a Relative Risk Model for Binary data with Log Link

Description

Fit a Relative Risk Model for Binary data with Log Link using the COPY method.

Usage

relRisk(formula, id, waves = NULL, data = parent.frame(),
        subset = NULL, contrasts = NULL, na.action = na.omit,
        corstr = "indep", ncopy = 1000,
        control = geese.control(), b = NULL, alpha = NULL)

Arguments

formula
same as in geese
id
same as in geese
waves
same as in geese
data
same as in geese
subset
same as in geese
contrasts
same as in geese
na.action
same as in geese
corstr
same as in geese
ncopy
the number of copies of the original data in constructing weight.
control
same as in geese
b
initial values for regression coefficients as in geese but more difficult to obtain due to the log link.
alpha
same as in geese

Value

  • An object of class "geese" representing the fit.

References

Lumley, T., Kornmal, R. and Ma, S. (2006). Relative risk regression in medical research: models, contrasts, estimators, and algorithms. UW Biostatistics Working Paper Series 293, University of Washington.

Examples

Run this code
## this example was used in Yu and Yan (2010, techreport)
data(respiratory)
respiratory$treat <- relevel(respiratory$treat, ref = "P")
respiratory$sex <- relevel(respiratory$sex, ref = "M")
respiratory$center <- as.factor(respiratory$center)
## 1 will be the reference level

fit <- relRisk(outcome ~ treat + center + sex + age + baseline + visit,
               id = id, corstr = "ar1", data = respiratory, ncopy=10000)
summary(fit)
## fit <- relRisk(outcome ~ treat + center + sex + age + baseline + visit,
##               id = id, corstr = "ex", data = respiratory)
## summary(fit)
## fit <- relRisk(outcome ~ treat + center + sex + age + baseline + visit,
##                id = id, corstr = "indep", data = respiratory)
## summary(fit)

Run the code above in your browser using DataLab