casecross(formula, data, exclusion=2, stratalength=28, matchdow=FALSE,
usefinalwindow=FALSE, matchconf='', confrange=0, stratamonth=FALSE)
stratalength
.matchconf
is the variable to match on. This matching is in addition to the strata matching.matchconf
(on case day) $+/-$ confrange
.stratalength
.coxph
.stratalength
, the default value is 28 days, so that cases and controls are compared in four week sections.
Smaller stratum lengths provide a closer control for season, but reduce the available number of controls.
Control days that are close to the case day may have similar levels of the independent variable(s). To reduce this correlation it is possible to place an exclusion
around the cases.
The default is 2, which means that the smallest gap between a case and control will be 3 days.
To remove any confounding by day of the week it is possible to additionally match by day of the week (matchdow
), although this often reduces the number of available controls. This matching is in addition to the strata matching.
It is possible to additionally match case and control days by an important confounder (matchconf
) in order to remove its effect. Control days are matched to case days if they are:
i) in the same strata, ii) have the same day of the week if matchdow=TRUE
, iii) have a value of matchconf
that is within $\pm$ confrange
of the value of matchconf
on the case day. If the range is set too narrow then the number of available controls will become too small, which in turn means the number of case days with at least one control day is compromised.
The method uses conditional logistic regression (see coxph
and so the parameter estimates are odds ratios.)
The code assumes that the data frame contains a date variable (in Date
format) called summary.casecross
, coxph
# cardiovascular disease data
data(CVDdaily)
# Effect of ozone on CVD death
model1 = casecross(cvd ~ o3mean+tmpd+Mon+Tue+Wed+Thu+Fri+Sat, data=CVDdaily)
summary(model1)
# match on day of the week
model2 = casecross(cvd ~ o3mean+tmpd,matchdow=TRUE, data=CVDdaily)
summary(model2)
# match on temperature to within a degree
model3 = casecross(cvd ~ o3mean+Mon+Tue+Wed+Thu+Fri+Sat, data=CVDdaily,
matchconf='tmpd', confrange=1)
summary(model3)
Run the code above in your browser using DataLab