getProbScalarRR: Calculate risks from log RR and log OP

Description Usage Arguments Details Value Examples

View source: R/getProbScalarRR.R

Description

Calculate risks from log RR and log OP

Usage

1
getProbScalarRR(logrr, logop = NA)

Arguments

logrr

log of relative risk

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))].

Value

a vector (P(y=1|x=0),P(y=1|x=1))

Examples

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

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

brm documentation built on May 30, 2017, 8:18 a.m.