Comments (9)
Please provide with an example in order to check whether my code or your input is the problem (as usual for requesting help for R packages). Otherwise, I am not able to fix the possible problem.
from miceadds.
Thanks for offering help. The data are from a RCT trial. I will be in trouble if I post it online. Will giving you the str() output be okay?
Sandro
from miceadds.
Or could you send me a subdataset which replicates the problem via email? str
does not seem to be sufficient.
from miceadds.
Thanks Alex for offering help. I have sent a subset of pseudo data to the email address you stated in the vignette. I bet it would be okay to discuss the reason to benefit everyone here. I guess the reason is about setting factor... and so.
from miceadds.
Hi Alex
Here are the settings:
(ini <- mice(dat, maxit = 0))
(pred<-ini$pred)
(pred[,]<-0)
pred[,"id"]<-(-2)
pred["outcome","id"]<-(-2)
pred["outcome",-c(1,3)]<-1
pred["outcome",c("strataIV","time")]<-0
(meth<-ini$meth)
meth[c("outcome")] <- "2l.pmm"
BTW, you may also be interested to know that parlmice() "could not found" mice.impute.2l.pmm. I then resolved the problem with doRNG.
Many thanks for your help.
Sandro
from miceadds.
I still do not see a model which includes the method mice.impute.bygroup
which was meant to cause a problem. Please provide a full script and complete information. It is important to minimize the amount of time for coping with possible problems by always giving the information as requested. This means code, data (or some subdataset) should be provided which EXACTLY reproduces the bug for which you are requesting help.
BTW, you may also be interested to know that parlmice() "could not found" mice.impute.2l.pmm. I
then resolved the problem with doRNG.
I think that is unrelated to mice.impute.2l.pmm
. Again, provide a reproducible example if you think that is really an issue.
from miceadds.
Hi Alex
Thank you very much for you reply.
According to the documentation, I would imagine that the rest of the codes should be:
meth["outcome"] <- "bygroup"
# by initial specification of meth become redundant
group <- list( "outcome"="strataIV" )
imputationFunction <- list("outcome"="2l.pmm" )
imp <- mice::mice( dat, meth=meth, pred=pred,
m=20, maxit=24, group=group, imputationFunction=imputationFunction )
Perhaps you may direct me the right coding...
Sandro
from miceadds.
I think that the issue was a mixture of problems. The warning message was caused by the fact that the grouping variable was not included in the predictorMatrix with a 1
entry. I changed this requirement in the recent update. Moreover, make sure that you do not include multicollinear predictors. The syntax now runs with the recent miceadds
version.
dat <- utils::read.table( "miceGroup.csv", sep=";", dec=".", header=TRUE)
ini <- mice(dat, maxit = 0)
pred<-ini$pred
(pred[,]<-0)
pred[,"id"]<-(-2)
pred["outcome","id"]<-(-2)
pred["outcome",-c(1,3)]<-1
pred["outcome",c("strataIV","time")]<-0
meth<-ini$meth
meth["outcome"] <- "bygroup"
group <- list( "outcome"="strataIV" )
imputationFunction <- list("outcome"="2l.pmm" )
# remove these columns to avoid multocollinearity of variables
pred[, c("gender","TX")] <- 0
# impute
imp <- mice::mice(dat, method=meth, predictorMatrix=pred, imputationFunction=imputationFunction,
group=group, m=1, maxit=2)
from miceadds.
from miceadds.
Related Issues (20)
- micombine.cor with Fisher transform? HOT 2
- mi.anova intercept? HOT 3
- groupwise imputation with ml.lmer? HOT 3
- summary() subscript out of bounds HOT 2
- subscript out of bounds HOT 5
- glm.cluster yielding wrong p-values HOT 3
- not able to impute using ml.lmer in v 3.3? HOT 3
- glm.cluster reliant on/generates NULL wgt__ value HOT 3
- Error when using 2lonly.function with polyreg HOT 2
- datlist2mids fails after subsetting if factors don't still contain all levels HOT 1
- pooling error with nested imputations HOT 1
- Memory limit error with weighted imputation HOT 1
- Error in weighted predictive mean matching method HOT 1
- different variable imputed values using same predictor variable - 2l.pmm HOT 3
- `mice.impute.ml.lmer` on large three-level dataset: `"binary"` logistic model returns error, 'hangs' when adding random slopes or interactions HOT 1
- Is it possible to convert mids objects to an Amelia object? HOT 2
- post hoc test for mi.anova
- Question on using mice.impute.imputeR.lmFun HOT 2
- Possible error in example for ml.lmer documentation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from miceadds.