epi2x2 {epibasix}R Documentation

Epidemiological 2x2 Contingency Table Analysis Tool

Description

This function analyzes 2x2 tables assuming either a case-control or cohort study. Information such as Pearson's chi-squared test, the odds ratio, risk difference and relative risk are computed, as well as confidence intervals.

Usage

epi2x2(X,alpha=0.05, digits=3)

Arguments

X

A 2x2 matrix in standard epidemiological format, that is, column one represents outcome present, column two outcome absent, while row one represents risk present and row two represents risk absent. This is crucial for correct computation of odds ratio and parameters.

alpha

The desired Type I Error Rate for Hypothesis Tests and Confidence Intervals

digits

Number of Digits to round calculations

Details

This function is similar to PROC FREQ in SAS, as it provides the comprehensive analysis of a 2x2 contingency table. Again, I must stress that the table must be entered in the appropriate format, or unsuitable estimates will result. In a case control study, cases should be entered as column one and controls as column two.

Value

X

The original input matrix.

Sy

Value for Pearson's Chi-squared statistic (with continuity correction).

Sy.p.value

P-value for the hypothesis test of no association.

Fisher.p.value

P-value for the hypothesis test of no association. (Using Fisher's Exact Test)

OR

Point Estimate of the odds ratio.

OR.CIL

Lower Confidence Limit for the odds ratio.

OR.CIU

Upper Confidence Limit for the odds ratio.

p1Co

Row One Risk (Cohort Study)

p2Co

Row Two Risk (Cohort Study)

rdCo

Risk difference (Cohort Study). That is p1Co - p2Co.

rdCo.CIL

Lower Confidence Limit for Risk Difference in a cohort study.

rdCo.CIU

Upper Confidence Limit for Risk Difference in a cohort study.

RR

Relative Risk (Cohort Study)

RR.CIL

Lower Confidence Limit for Relative Risk in a cohort study.

RR.CIU

Upper Confidence Limit for Relative Risk in a cohort study.

p1CC

Column One Risk (Case-Control Study)

p2CC

Column Two Risk (Case-Control Study)

rdCC

Risk difference (Case-Control Study). That is p1CC - p2CC.

rdCC.CIL

Lower Confidence Limit for Risk Difference in a case-control study.

rdCC.CIU

Upper Confidence Limit for Risk Difference in a case-control study.

alpha

The desired Type I Error Rate for Hypothesis Tests and Confidence Intervals

digits

Number of Digits to round calculations

Author(s)

Michael Rotondi, mrotondi@yorku.ca

References

Szklo M and Nieto FJ. Epidemiology: Beyond the Basics, Jones and Bartlett: Boston, 2007.

See Also

mcNemar

Examples

data <- cbind(c(100, 225), c(58, 45));
summary(epi2x2(data));

[Package epibasix version 1.5 Index]