Open wleoncio opened 3 years ago
Using cluster_gen() with select() leaves the unsampled PSUs as data frames filled with NAs. There could be an argument on cluster_gen to clean those up afterwards
cluster_gen()
select()
cluster_gen
set.seed(1) df <- cluster_gen( n = select(sch = 1, cl = 2, st = 4), N = list(school = 2, class = c(3, 2), student = c(5, 4, 5, 5, 5)), n_X = 1, n_W = 1, verbose = FALSE ) df
Problematic part highlighted:
Calling cluster_gen(..., cleanup=TRUE) would return a data frame without the NA-laden data frames.
cluster_gen(..., cleanup=TRUE)
2.0.2.9008
Summary
Using
cluster_gen()
withselect()
leaves the unsampled PSUs as data frames filled with NAs. There could be an argument oncluster_gen
to clean those up afterwardsMRE
Observed output
Problematic part highlighted:
Expected output
Calling
cluster_gen(..., cleanup=TRUE)
would return a data frame without the NA-laden data frames.lsasim version
2.0.2.9008