Skip to content

Commit 3c93feb

Browse files
committed
Remove subgroup order check for individual-level data
1 parent c12376c commit 3c93feb

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

R/aci.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ aci <- function(est,
135135
stop('Subgroup order variable needs to be declared')
136136
}
137137
sorted_order <- sort(subgroup_order)
138-
if (any(diff(sorted_order) != 1) || any(sorted_order %% 1 != 0)) {
138+
if (!is.null(pop) &
139+
(any(diff(sorted_order) != 1) || any(sorted_order %% 1 != 0))) {
139140
stop('Subgroup order variable must contain integers in increasing order')
140141
}
141142
if (!is.null(weight) & !is.numeric(weight)) {

R/rci.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ rci <- function(est,
145145
stop('Subgroup order variable needs to be declared')
146146
}
147147
sorted_order <- sort(subgroup_order)
148-
if (any(diff(sorted_order) != 1) || any(sorted_order %% 1 != 0)) {
148+
if (!is.null(pop) &
149+
(any(diff(sorted_order) != 1) || any(sorted_order %% 1 != 0))) {
149150
stop('Subgroup order variable must contain integers in increasing order')
150151
}
151152
if (!is.null(weight) & !is.numeric(weight)) {

R/rii.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ rii <- function(est,
154154
stop('Subgroup order variable needs to be declared')
155155
}
156156
sorted_order <- sort(subgroup_order)
157-
if (any(diff(sorted_order) != 1) || any(sorted_order %% 1 != 0)) {
157+
if (!is.null(pop) &
158+
(any(diff(sorted_order) != 1) || any(sorted_order %% 1 != 0))) {
158159
stop('Subgroup order variable must contain integers in increasing order')
159160
}
160161
if (!is.null(weight) & !is.numeric(weight)) {

R/sii.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ sii <- function(est,
151151
stop('Subgroup order variable needs to be declared')
152152
}
153153
sorted_order <- sort(subgroup_order)
154-
if (any(diff(sorted_order) != 1) || any(sorted_order %% 1 != 0)) {
154+
if (!is.null(pop) &
155+
(any(diff(sorted_order) != 1) || any(sorted_order %% 1 != 0))) {
155156
stop('Subgroup order variable must contain integers in increasing order')
156157
}
157158
if (!is.null(weight) & !is.numeric(weight)) {

0 commit comments

Comments
 (0)