You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
@matthias-da fixed bug with commit f76e4c1 in simContinuous() when zero=TRUE was specified.
As stated in the issue missing values where not treated correctly when synthesizing 0s. Now for the 0-modelling step the missing values will be imputed with VIM::hotdeck() and a warning is raised. This code snipped was already in the function but commented out.
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.The text was updated successfully, but these errors were encountered: