| effx.match {Epi} | R Documentation |
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.
effx.match(response, exposure, match, strata=NULL, control=NULL, base=1, digits=3, alpha=0.05, data=NULL)
response |
The response variable - must be numeric |
exposure |
The exposure variable can be numeric or a factor |
match |
The variable which identifies the matched sets |
strata |
The strata stratifying variable - must be a factor |
control |
The control variable(s). These are passed as a
list if there are more than one of them. |
base |
Baseline for the effects of a categorical exposure, default 1 |
digits |
Number of significant digits for the effects, default 3 |
alpha |
1 - confidence level |
data |
data refers to the data used to evaluate the function |
Effects are calculated odds ratios. The function is a wrapper for clogit, from the survival package. The k-1 effects for a categorical exposure with k levels are relative to a baseline which, by default, is the first level. The effect of a metric (quantitative) exposure is calculated per unit of exposure. The exposure variable can be numeric or a factor, but if it is an ordered factor the order will be ignored.
comp1 |
Effects of exposure |
comp2 |
Tests of significance |
The function attaches the frame specified in the
data= argument, so there is a possibility that a variable in the
Global environment is masked by the attached frame. Watch out for this
warning in the output!
Michael Hills
www.mhills.pwp.blueyonder.co.uk
library(Epi) library(survival) data(bdendo) # d is the case-control variable, set is the matching variable. # The variable est is a factor and refers to estrogen use (yes,no) # The variable age is numeric and refers to estrogen use (yes,no) # effect of est on the odds of being a case effx.match(d,exposure=est,match=set,data=bdendo) # effect of age on the odds of being a case effx.match(d,exposure=age,match=set,data=bdendo)