Comments (3)
I agree that overwriting wgt__
produces an error. I just did not see an alternative simple method to get the lm formula evaluation running inside the function.
from miceadds.
I have been having the same issue as the original poster when calling lm.cluster and glm.cluster within a larger function. Is the best strategy for now to set wgt__ <- NULL just before calling the larger function, as he suggested? Or will this cause other problems that I'm not foreseeing?
from miceadds.
@b-johns , adding wgt__ <- NULL before calling the function is a good solution if you do not use weight in glm.cluster. In this case, weight
argument in glm.cluster
is NULL
and corresponds to what has been created before calling the function. If you use weight
in glm.cluster
, the best way is to add wgt__ <<- weight
before glm.cluster, where weight is the vector of weights plugged into the function glm.cluster
. Here is an example.
f <- function(...){
....
wgt__ <<- wghts
mTP <- glm.cluster(formula = y ~ X, cluster = 'IDClass', weights = wghts, data = data)
....
}
The line wgt__ <<- wghtsP
creates wgt__
in the global environment because of the assignment approach <<-
. This makes sure that the weight wgt__
created is the one used in the function glm.cluster
. If there are no weights, wgt__ <<- wghtsP
can be replaced with wgt__ <<- NULL
.
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
- mice.impute.bygroup - outs of bounds HOT 9
- glm.cluster yielding wrong p-values HOT 3
- not able to impute using ml.lmer in v 3.3? 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.