Closed benthestatistician closed 5 years ago
Easier to reproduce example of same:
library(optmatch) ; library(magrittr)
data(nuclearplants)
np_mod <- nuclearplants
which(np_mod$pt==1)
## [1] 27 28 29 30 31 32
np_mod[which.max(np_mod$pt==1), "pr"] <- NA
np_mod %>% fullmatch(pr~cap + strata(pt), min.c=2, data=.) %>%
optmatch:::subproblemSuccess()
## 0 1
## TRUE FALSE
np_mod %>% fullmatch(pr~cap + strata(pt), min.c=2, data=.) %>% summary()
## Error in dimnames(so$matching.failed) <- `*vtmp*` :
## length of 'dimnames' [2] not equal to array extent
Here's a match with two subproblems, s.t. for one of the subproblems matching fails. (See comments for another example.) Unfortunately
summary()
also fails:Looking inside I think I see the problem:
generates
and then the last
<NA>
column is unexpected further down. (NB: it seems that last NA column only comes about if the failing subproblem had an NA in the treatment variable.)If for instance we put
then we'd get
and all else would go through.