Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mice.imput.gamlss example not working #4

Open
tmerkling opened this issue Feb 7, 2019 · 0 comments
Open

mice.imput.gamlss example not working #4

tmerkling opened this issue Feb 7, 2019 · 0 comments

Comments

@tmerkling
Copy link

Hello,

I'm trying to impute missing data from a highly overdispersed and zero-inflated count variable and came across your package.
After failing to use the 'gamlssZIP' on my data I tried to run the example from the help page and it seems to fail too (although there are no error messages), as there are no imputed values for X.2 and X.3 but only NAs when I do imputed.sets$imp$X.2.

I asked a colleague to try to run the example and it worked on his computer, which had the same package versions loaded but just differed by the fact that it's 64-bit Windows while mine is 32-bit.

I then asked him to run the function on a subset of my data but he got the same issue of having 'NA' instead of imputed values.

Below is the code I used and my sessionInfo() (I'm not attaching the data on GitHub, but can maybe send a subset privately if I get the authorization).

Thanks in advance for your help!
Thomas

sub_hydrat <- read.table("Stats_Hydratation/sub_data_Thomas.csv", header = TRUE, sep = ";")

head(sub_hydrat)

apply(sub_hydrat, 2, function(x){any(is.na(x))})
only GPAQ_ptotal has missing values

init_im <- mice(sub_hydrat, maxit=0, print=F)

im_pred <- init_im$predictorMatrix
im_pred[c("date_inclu", "FUP_irt", "irt", "FUP_deces", "deces", "conso_eau", "conso_eau_cls", "SEXE", "region_new", "AGEI", "origine_fac", "saison_fac", "tabac_fac", "neph_type_fac", "stadeincb", "fluide_ss_eau", "dfgin"),] <- 0

ZI_meth <- init_im$method
ZI_meth["GPAQ_ptotal"] <- "gamlssZIP"

im_ZIP <- mice(sub_hydrat, m = 1, maxit = 2, seed = 300119, meth = ZI_meth, pred = im_pred, n.cyc = 1, bf.cyc = 1, cyc = 1)

im_ZIP$imp$GPAQ_ptotal
gives a vector of NA instead of imputed data ...`

R version 3.5.1 (2018-07-02)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 7 (build 7601) Service Pack 1

Matrix products: default
locale:
[1] LC_COLLATE=French_France.1252 LC_CTYPE=French_France.1252
[3] LC_MONETARY=French_France.1252 LC_NUMERIC=C
[5] LC_TIME=French_France.1252

attached base packages:
[1] parallel splines stats graphics grDevices utils
[7] datasets methods base
other attached packages:
[1] bindrcpp_0.2.2 ImputeRobust_1.3-1 mice_3.3.0
[4] lattice_0.20-35 gamlss_5.1-2 nlme_3.1-137
[7] gamlss.dist_5.1-1 MASS_7.3-50 gamlss.data_5.1-0

loaded via a namespace (and not attached):
[1] digest_0.6.18 minqa_1.2.4 R6_2.3.0
[4] gWidgets_0.0-54.1 assertthat_0.2.0 grid_3.5.1
[7] tcltk_3.5.1 gWidgetstcltk_0.0-55 broom_0.5.1
[10] survival_2.42-3 tidyselect_0.2.5 extremevalues_2.3.2
[13] generics_0.0.2 lme4_1.1-19 pillar_1.3.0
[16] compiler_3.5.1 tibble_1.4.2 tidyr_0.8.2
[19] nnet_7.3-12 pkgconfig_2.0.2 pan_1.6
[22] purrr_0.2.5 Matrix_1.2-15 rstudioapi_0.8
[25] glue_1.3.0 mitml_0.3-7 magrittr_1.5
[28] rlang_0.3.0.1 yaml_2.2.0 tools_3.5.1
[31] bindr_0.1.1 dplyr_0.7.8 jomo_2.6-6
[34] nloptr_1.2.1 crayon_1.3.4 rpart_4.1-13
[37] backports_1.1.2 Rcpp_1.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant