riskdiff {catfun}R Documentation

Risk difference

Description

Calculate risk difference and 95 percent confidence interval using Wald method.

Usage

riskdiff(df, ...)

Arguments

df

a dataframe with binary variables x and y or a 2 x 2 frequency table/matrix. If a table or matrix, x and y must be NULL. Used to select method.

...

further arguments passed to or from other methods.

Value

a list with class "rdiff" containing the following components:

rd

risk difference

conf.level

specified confidence level

ci

calculated confidence interval

p1

proportion one

p2

proportion two

tab

2x2 table using for calculating risk difference

Examples

trial <- data.frame(
  disease = c(rep("yes", 2), rep("no", 2)),
  treatment = c(rep(c("estrogen", "placebo"), 2)),
  count = c(751, 623, 7755, 7479))

riskdiff(trial, treatment, disease, count, rev = "columns")


[Package catfun version 0.1.4 Index]