Closed Kyoshido closed 2 years ago
Yes, the "distribution"-method gives this error, we will work on a fix. In the meantime, the other methods in simCategorical work fine.
Reproduced:
library(simPop)
data(eusilcS)
inp <- specifyInput(data=eusilcS, hhid="db030", hhsize="hsize", strata="db040", population = TRUE)
## in the following, nr_cpus are selected automatically
simPop <- simStructure(data=inp, method="direct", basicHHvars=c("age", "rb090"))
simPop <- simCategorical(simPop, additional=c("pl030", "pb220a"),
method="distribution", nr_cpus=1)
Hello, I have this error
Problem occurred during function simCategorical() with model method = "distribution". The problem lies in other function generateValues_distribution.
Error "attempt to select less than one element in get1index" occurs when we use NULL as an index. There is following code:
And the problem is in
dataSample[[w]][i])
Because I want to model whole population, my weights are NULL. And the w = NULL cause an error. This happened because in specifyInput.R the function is set with weight=NULL and from then the NULL travels.