inst/doc/stratified-2x2-tables.R

## ----setup, include=FALSE-------------------------------------------------------------------------
knitr::opts_chunk$set(comment = NA)
options(width = 100)
library(sasLM)

## -------------------------------------------------------------------------------------------------
RD(7, 10, 3, 10) # y1, n1, y2, n2
RR(7, 10, 3, 10)
OR(7, 10, 3, 10)

## -------------------------------------------------------------------------------------------------
RDmn1(7, 10, 3, 10)
RRmn1(7, 10, 3, 10)
ORmn1(7, 10, 3, 10)

## -------------------------------------------------------------------------------------------------
RDmn1(10, 10, 0, 10)
RRmn1(10, 10, 1, 10)

## -------------------------------------------------------------------------------------------------
d0 = data.frame(y1=c(25, 23), n1=c(339, 370), y2=c(28, 40), n2=c(335, 364))
RDmn(d0)
RRmn(d0)
ORmn(d0)

## -------------------------------------------------------------------------------------------------
d1 = data.frame(y1=c(25, 23), n1=c(339, 370), y2=c(28, 40), n2=c(335, 364))
RRinv(d1)

## -------------------------------------------------------------------------------------------------
ORcmh(d1)

## -------------------------------------------------------------------------------------------------
aspirinCHD
ORmn(aspirinCHD)$Common
ORinv(aspirinCHD)$Common

Try the sasLM package in your browser

Any scripts or data that you put into this service are public.

sasLM documentation built on July 14, 2026, 5:06 p.m.