We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6aed1d3 commit d6ce10fCopy full SHA for d6ce10f
R/ALD_stats.R
@@ -115,13 +115,17 @@ link_transform <- function(p, family) {
115
#'
116
link_transform_var <- function(y, N, family) {
117
link <- family$link
118
+ p <- y/N
119
120
if (link == "logit") {
121
# log-OR
122
return(1/y + 1/(N - y))
123
} else if (link == "log") {
124
# log-RR
- return(1/y)
125
+ return((1-p)/(p*n))
126
+ } else if (link == "log") {
127
+ # log-RD
128
+ return((1-p)/n)
129
} else {
130
##TODO: replace all? and move to trial_variance()
131
(1 / (family$mu.eta(y/N)^2)) * family$variance(y/N) # delta method
0 commit comments