getProbRD: Calculate risks from arctanh RD and log OP (vectorised)

Description Usage Arguments Details Value Examples

View source: R/getProbScalarRD.R

Description

Calculate risks from arctanh RD and log OP (vectorised)

Usage

1
getProbRD(atanhrd, logop)

Arguments

atanhrd

arctanh of risk difference

logop

log of odds product

Details

The log OP is defined as log OP = log[(P(y=1|x=0)/P(y=0|x=0))*(P(y=1|x=1)/P(y=0|x=1))]. The inverse hyperbolic tangent function arctanh is defined as arctanh(z) = [log(1+z) - log(1-z)] / 2.

Value

a matrix (P(y=1|x=0),P(y=1|x=1)) with two columns

Examples

1
2
3
4
5
6
7
8
getProbRD(0,0)

set.seed(0)
logrr = rnorm(10,0,1)
logop = rnorm(10,0,1)
probs = getProbRD(logrr, logop)
colnames(probs) = c("P(y=1|x=0)","P(y=1|x=1)")
probs

mclements/brm documentation built on June 20, 2020, 9:22 p.m.