library(simPop)
data(eusilc13puf, package = "simPop")
df <- eusilc13puf[,c(1:6, 8:9,14, 16, 46)]
df$age <- as.numeric(df$age)
df$pid <- as.factor(df$pid)
vars <- c("hhid", "hsize", "region", "age", "sex", "pid", "eco_stat", "citizenship",
"pgrossIncome","hgrossIncome","weight")
colnames(df) <- vars
# We are using reduced weights to obtain a reduced population by factor 100 for computation time
df$weight <- df$weight/100
Reason is most likely related missing values in variable ecoStat that causes in line 338 of simContinous
X <- model.matrix(estimationModel, data = dataS) # has about 10000 rows
y <- dataS[[name]] # has more than 13000 entries
weights <- dataS[[weight]] # has more than 13000 entries
Afterwards mod <- logitreg(X, y, weights = weights) fails.
Here is an executable example:
Data:
And here comes the error:
Reason is most likely related missing values in variable
ecoStat
that causes in line 338 ofsimContinous
Afterwards
mod <- logitreg(X, y, weights = weights)
fails.