cc {epicalc}R Documentation

Odds ratio calculation and graphing

Description

Odds ratio calculation and graphing

Usage

cc(outcome, exposure, decimal = 2, cctable = NULL, graph = TRUE, 
        design = "cohort") 
cci(caseexp, controlex, casenonex, controlnonex, cctable = NULL, 
        decimal = 2, graph = TRUE, design = "cohort") 
cs(outcome, exposure, cctable = NULL, decimal = 2)
csi(caseexp, controlex, casenonex, controlnonex, cctable = NULL, 
        decimal = 2) 
graph.casecontrol(caseexp, controlex, casenonex, controlnonex,
         decimal=2) 
graph.prospective(caseexp, controlex, casenonex, controlnonex,
         decimal=2) 
labelTable(outcome, exposure, cctable = NULL, cctable.dimnames = NULL) 
mhor(..., mhtable = NULL, decimal=2, graph = TRUE, design = "cohort") 
make2x2(caseexp, controlex, casenonex, controlnonex)

Arguments

... Variables. Three for 'mhor'.
cctable.dimnames Dimension names of the variables, usually omitted
decimal number of decimal places displayed
outcome, exposure two dichotomous variables
cctable A 2-by-2 table. If specified, will supercede the outcome and exposure variables
graph If TRUE (default), produces an odds ratio plot
design Specification for graph; can be "case control","case-control", "cohort" or "prospective"
mhtable a 2-by-2-by-s table, where s (strata) is more than one
caseexp Number of cases exposed
controlex Number of controls exposed
casenonex Number of cases not exosed
controlnonex Number of controls not exposed

Details

'cc' and 'cci' compute odds ratios and 95 percent confidence intervals from a dataset or from four numbers entered manually. The results are based on the exact method.

'cs' and 'csi' are for cohort and cross-sectional studies. They compute absolute risks, risk difference, risk ratio. When the exposure is a risk factor, additional results are attributable fraction exposure and attributable fraction population. When the exposure is a protective factor, protective efficacy and number needed to treat (NNT) are given instead.

'make2x2' creates a 2-by-2 table using the above orientation.

'graph.casecontrol' and 'graph.prospective' draw a graph comparison of odds of exposure between cases and controls or odds of diseased between exposed and non-exposed.

These two graphic commands are automatically called by 'cc' and 'cci'.

Alternatively, a table saved from 'make2x2' can be supplied as the 'cctable' argument for the 'cc' command. The squares on the values of each group (case vs control and exposed vs unexposed) represent the relative sample sizes for each group.

'mhor' computes stratum-specific odds ratios and 95 percent confidence intervals and the Mantel-Hanzsel odds ratio and chi-squared test is given as well as the homogeneity test. A stratified odds ratio graph is displayed.

Author(s)

Virasakdi Chongsuvivatwong <cvirasak@medicine.psu.ac.th>

See Also

'fisher.test', 'chisq.test' and 'mhor'

Examples

data(Oswego)
.data <- Oswego
attach(.data)

# The above lines generate a hypothetical data frame. 
# In reality, one just exploits 'use("Oswego.rec"), if the file is available.
cc(ill, chocolate)
cc(ill, chocolate, design="case-control")
cs(ill, chocolate) # The outcome variable should come before the exposure.
mhor(ill, chocolate, sex)

mht1 <- table(ill, chocolate, sex)
dim(mht1)
mhor(mhtable=mht1) # same results

#    For the following table
#          chocolate
#    ill     FALSE TRUE
#     FALSE     7   22
#     TRUE     20   25
#
cci(25, 22, 20, 7)
graph.casecontrol(25, 22, 20, 7)
graph.prospective(25, 22, 20, 7)

#Alternatively
table1 <- make2x2(25,70,22,7)
cc(outcome=NULL, exposure=NULL, cctable=table1)
cs(outcome=NULL, exposure=NULL, cctable=table1)


[Package epicalc version 2.4.0.11 Index]