Learn R Programming

Epi (version 0.7.0)

epi.eff: Function to calculate effects

Description

The function calculates the effects of an exposure on a response, possibly stratified by a stratifying variable, and/or controlled for one of more confounding variables.

Usage

epi.eff(response, type = "metric", exposure, strata = NULL, control = NULL, fup = NULL, data = NULL)

Arguments

response
The response variable - must be numeric
type
The type of responsetype - must be one of "metric", "binary", "failure", or "count"
exposure
The exposure variable can be numeric or a factor
strata
The strata stratifying variable - must be a factor
control
The control variable(s) - must take the form data.frame(variable names)
fup
The fup variable contains the follow-up time for a failure response
data
data refers to the data frame used

Value

  • comp1Effects of exposure
  • comp2Tests of significance

Details

epi.eff(), without arguments, produces a list of arguments

Examples

Run this code
data(births)
attach(births)
epi.eff(response=bweight,type="metric",exposure=hyp)
epi.eff(response=lowbw,type="binary",exposure=hyp)
sex <- factor(sex)
epi.eff(response=bweight,type="metric",exposure=hyp,strata=sex)
epi.eff(response=lowbw,type="binary",exposure=hyp,strata=sex)

Run the code above in your browser using DataLab