Description Usage Arguments Details Value Examples
View source: R/getProbScalarRD.R
Calculate risks from arctanh RD and log OP
1 | getProbScalarRD(atanhrd, logop)
|
atanhrd |
arctanh of risk difference |
logop |
log of odds product |
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.
a vector (P(y=1|x=0),P(y=1|x=1))
1 2 3 4 5 6 7 8 | getProbScalarRD(0,0)
set.seed(0)
logrr = rnorm(10,0,1)
logop = rnorm(10,0,1)
probs = mapply(getProbScalarRD, logrr, logop)
rownames(probs) = c("P(y=1|x=0)","P(y=1|x=1)")
probs
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.