Skip to content

Commit ab51ae3

Browse files
committed
Fix issue in chi-square function for dichotomous model
1 parent 2d4ae86 commit ab51ae3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/dichotModel.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ dichotIPRelRisk <- function(alpha, power, p0, n, m,
667667

668668
# Solve the equation for the lower solution.
669669
p1l <- try({
670-
uniroot(dichotChiSqSize, c(y1, y2), alpha = alpha, beta = beta, p0 = p0, n = n, m = 1)$root
670+
uniroot(dichotChiSqSize, c(y1, y2), alpha = alpha, beta = beta, p0 = p0, n = n, m = m)$root
671671
})
672672

673673
# Set initial end points for high end point.
@@ -676,7 +676,7 @@ dichotIPRelRisk <- function(alpha, power, p0, n, m,
676676

677677
# Solve the equation for the upper solution.
678678
p1h <- try({
679-
uniroot(dichotChiSqSize, c(y1, y2), alpha = alpha, beta = beta, p0 = p0, n = n, m = 1)$root
679+
uniroot(dichotChiSqSize, c(y1, y2), alpha = alpha, beta = beta, p0 = p0, n = n, m = m)$root
680680
})
681681
}
682682
else if (method == "fishers") {

0 commit comments

Comments
 (0)