RDinv: Risk Difference between two groups with strata by inverse...

View source: R/RDinv.R

RDinvR Documentation

Risk Difference between two groups with strata by inverse variance method

Description

Risk difference and its confidence interval between two groups with stratification by the inverse variance method

Usage

  RDinv(d0, conf.level=0.95)

Arguments

d0

A data.frame or matrix, of which each row represents a stratum. This should have four columns named y1, n1, y2, and n2; y1 and y2 for events of each group, n1 and n2 for the sample size of each stratum. The second group is usually the control group.

conf.level

confidence level

Details

It calculates the risk difference and its confidence interval between two groups by the inverse variance method. The common risk difference is given by both the fixed effect model and the DerSimonian-Laird random effects model, with Cochran's Q test for heterogeneity. If you need the percent scale, multiply the output by 100. This can be used for meta-analysis also.

Value

RDs

risk difference and its confidence interval of each stratum

Heterogeneity

Cochran's Q statistic for heterogeneity across the strata and its p-value

tau2

between-strata variance estimated by the method of moments

Fixed

common risk difference, its standard error, and its confidence interval by the fixed effect model with the inverse variance weights

Random

common risk difference, its standard error, and its confidence interval by the DerSimonian-Laird random effects model

Author(s)

Kyun-Seop Bae k@acr.kr

See Also

RDmn1, RRmn1, ORmn1, RDmn, RRmn, ORmn, RRinv, ORinv, ORcmh

Examples

  d1 = matrix(c(25, 339, 28, 335, 23, 370, 40, 364), nrow=2, byrow=TRUE)
  colnames(d1) =  c("y1", "n1", "y2", "n2")
  RDinv(d1)

sasLM documentation built on June 15, 2026, 9:07 a.m.