Skip to content

Commit 3e7e040

Browse files
committed
Fix reference_subgroup check
1 parent 8717569 commit 3e7e040

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

R/mdru.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ mdru <- function(est,
9999
if (!is.numeric(se))
100100
stop('Standard errors need to be numeric')
101101
}
102-
if (sum(reference_subgroup) !=1 ) {
103-
stop('Reference subgroup variable is missing')
102+
if (sum(reference_subgroup) < 1 ) {
103+
stop('Reference subgroup is missing')
104104
}
105105
if (sum(reference_subgroup) > 1) {
106106
stop('Reference subgroup variable must identify one reference subgroup

R/mdrw.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ mdrw <- function(est,
113113
if (all(pop == 0)) {
114114
stop('Population variable is of size 0 in all subgroups')
115115
}
116-
if (sum(reference_subgroup) !=1 ) {
117-
stop('Reference subgroup variable is missing')
116+
if (sum(reference_subgroup) < 1 ) {
117+
stop('Reference subgroup is missing')
118118
}
119119
if (sum(reference_subgroup) > 1) {
120120
stop('Reference subgroup variable must identify one reference subgroup

0 commit comments

Comments
 (0)