*! version 1.1.9 12feb2024

Title

sta -- Association Measures (non stratified frequency data)

Syntax

sta var_response var_exposure [if] [in], data(freq) [options]

stai #a1 #a0 #b1 #b0, data(freq) [options]

st(type) study type; valid values are: default is st(cs)
cs (cross-sectional)

co (cohort)
ex (experimental)
cc (case-control)

wilson calculate Wilson confidence intervals; the default

exact calculate exact confidence intervals

wald calculate Wald confidence intervals

pearson calculate Pearson association chi-squared; the default

mh calculate Mantel-Haenszel association chi-squared

zero(correct) continuity correction for cells with zero events:

n None default is zero(n)

c Constant, add k=0.5 to each cell

p Proportional, add k1=N1/N and k0=N0/N for ex, co & cs studies

add k1=M1/N and k0=M0/N for cc studies

r Reciprocal, add k1=1/N0 and k0=1/N1 for ex, co & cs studies

add k1=1/M0 and k0=1/M1 for cc studies

The recommended correction is reciprocal

notables do not show 2x2 frequency tables; by default, 2x2 tables are shown

level(#) confidence level (%); the default is level(95)

detail display additional statistics

pe(#) proportion of exposed in the population

r(#) proportion of cases in the population; case-control type only

rare rare disease; case-control type only

nnt(#) compute number needed to treat. The code is 1 for a benefit outcome (default) and 0 for a harmful outcome; experimental and cohort type only

nst(string) name of the study (label)

Description

Measures of Association for non stratified frequency data.

Cross-sectional, cohort, experimental and case-control studies are available. The command needs the response and
exposure variables to compute the results.

For experimental and cohort studies [st(ex), st(co)] the number needed to treat may be computed with option nnt.

For case-control studies [st(cc)] only one of r or pe may be included.

Proportion of exposed in the population [pe()] may be included when additional statistics [detail] are
computed for cross-sectional, cohort and experimental studies.

Newcombe (method 10) and Wald confidence intervals are computed for the Risk Difference (RD).

stai is the immediate form of sta; see immed. The sequence of #a1, #a0, #b1
and #b0 come from a contingency table:

|UnExposed| Exposed | Total

+
+
+------

Events | a0 | a1 | m1

NonEvents | b0 | b1 | m0

+
+
+------

Total | n0 | n1 | n

Examples

Cross-Sectional

. use http://metodo.uab.cat/stata/ObesArt.dta

. sta Art Obes, data(freq) st(cs) wilson nst(Study name)

. stai 9 1 1191 999, data(freq) st(cs) wilson

. stai 9.4 1 1190.6 999, data(freq) st(cs)

Cohort

. use http://metodo.uab.cat/stata/SmokePreterm.dta

. sta Preterm Smoke, data(freq) st(co) wilson

. sta Preterm Smoke, data(freq) st(co) wilson pe(0.4) detail

. stai 100 90 100 990, data(freq) st(co) exact

Experimental

. use http://metodo.uab.cat/stata/TreatHeal.dta

. sta Heal Treat, data(freq) st(ex) wilson

. stai 100 90 100 990, data(freq) st(ex) nnt(1)

. stai 100 0 100 1080, data(freq) st(ex) zero(c)

Case-Control

. use http://metodo.uab.cat/stata/SmokeCancer.dta

. sta Cancer Smoke, data(freq) st(cc) wilson

. use http://metodo.uab.cat/stata/ContrCancer.dta

. sta Cancer Contr, data(freq) st(cc) wilson

. sta Cancer Contr, data(freq) st(cc) wilson r(0.0003) detail rare

. stai 10 90 2 198, data(freq) st(cc) wald

. stai 10 90 2 198, data(freq) st(cc) r(0.0900909)

. stai 100 0 2 198, data(freq) st(cc) pe(0.018108) zero(r)

Stored results

The command stores the following scalars in r():

All

r(a0) number of cases unexposed

r(a1) number of cases exposed

r(m1) total number of cases

r(b0) number of noncases/controls unexposed

r(b1) number of noncases/controls exposed

r(m0) total number of noncases/controls

r(n0) total number of unexposed

r(n1) total number of exposed

r(n) total number of observations

r(or) odds ratio

r(lb_or_corn) Cornfield lower bound of CI for or

r(ub_or_corn) Cornfield upper bound of CI for or

r(lb_or_exact) Exact lower bound of CI for or (Case-Control only)

r(ub_or_exact) Exact upper bound of CI for or (Case-Control only)

r(lb_or_woolf) Woolf lower bound of CI for or

r(ub_or_woolf) Woolf upper bound of CI for or

r(se_or_woolf) Woolf estimate of standard error of or

r(chi2) chi-squared

r(p) two-sided p-value

r(chi2_corr) corrected chi-squared

r(p_corr) corrected two-sided p-value

r(p_exact) Fisher exact test two-sided p-value

r(pe_pop) Proportion of exposed in the population (detail only for Cross-Sectional, Cohort & Experimental)

r(afe) attributable fraction exposed (detail only, whenever it's convenient)

r(lb_afe) lower bound of CI for afe (detail only, whenever it's convenient)

r(ub_afe) upper bound of CI for afe (detail only, whenever it's convenient)

r(afp) attributable fraction population (detail only, whenever it's convenient)

r(lb_afp) lower bound of CI for afp (detail only, whenever it's convenient)

r(ub_afp) upper bound of CI for afp (detail only, whenever it's convenient)

r(se_afp) estimate of standard error of afp (detail only, whenever it's convenient)

r(pfe) preventable fraction exposed (detail only, whenever it's convenient)

r(lb_pfe) lower bound of CI for pfe (detail only, whenever it's convenient)

r(ub_pfe) upper bound of CI for pfe (detail only, whenever it's convenient)

r(pfp) preventable fraction population (detail only, whenever it's convenient)

r(lb_pfp) lower bound of CI for pfp (detail only, whenever it's convenient)

r(ub_pfp) upper bound of CI for pfp (detail only, whenever it's convenient)

Cross-sectional

r(pd) prevalence difference

r(lb_pd_new) Newcombe lower bound of CI for pd

r(ub_pd_new) Newcombe upper bound of CI for pd

r(lb_pd_wald) Wald lower bound of CI for pd

r(ub_pd_wald) Wald upper bound of CI for pd

r(se_pd_wald) Wald estimate of standard error of pd

r(pr) prevalence ratio

r(lb_pr) lower bound of CI for pr

r(ub_pr) upper bound of CI for pr

r(se_pr) estimate of standard error of pr

r(pdp) prevalence difference in the population (detail only)

r(lb_pdp) lower bound of CI for pdp (detail only)

r(ub_pdp) upper bound of CI for pdp (detail only)

r(se_pdp) estimate of standard error of pdp (detail only)

Cohort & Experimental

r(rd) risk difference

r(lb_rd_new) Newcombe lower bound of CI for rd

r(ub_rd_new) Newcombe upper bound of CI for rd

r(lb_rd_wald) Wald lower bound of CI for rd

r(ub_rd_wald) Wald upper bound of CI for rd

r(se_rd_wald) Wald estimate of standard error of rd

r(rr) risk ratio

r(lb_rr) Woolf lower bound of CI for rr

r(ub_rr) Woolf upper bound of CI for rr

r(se_rr) Woolf estimate of standard error of rr

r(rdp) risk difference in the population (detail only)

r(lb_rdp) lower bound of CI for rdp (detail only)

r(ub_rdp) upper bound of CI for rdp (detail only)

r(se_rdp) estimate of standard error of rdp (detail only)

Case-Control

r(r) population risk (when available)

r(pe) exposed proportion (when available)

r(pr) proportion ratio (when available)

r(pd) proportion difference (when available)

r(pdp) proportion difference in the population (detail only})