Comments (25)
from ggeffects.
I just had a similar issue with the ggpredict function. Setting ci.lvl = NA made it work without the vector allocation error (although ggeffect worked for me). With other lme4 prediction tools they can use some intensive methods for degrees of freedom calculations so that may be it.
from ggeffects.
If one of the terms is continuous, try to specify some values, e.g. terms = "cont_var [10, 20, 30, 40, 50]"
, if cont_var
ranges from 10 to 50. I use expand.grid()
on all possible values, and computation of CI might be very memory consuming in such cases. The effects package, by default, does not compute effects and CI for all possible values, but for a selection only.
from ggeffects.
Could you please check if this issue still exists in the current dev-version? I have added a pretty
argument, which creates a sequence of "pretty" numbers for predictor terms with many unique values.
from ggeffects.
Since pretty
does not plot splines nicely, I've changed the default to pretty = FALSE
. So, if possible, please check if ggpredict(..., pretty = TRUE)
solves your issue.
from ggeffects.
I am having same issue with ggeffects::ggalleffects
which blows to 15GB for 64k row x 9col data set. ggeffects::predict
doesn't work for me because I have sales(forecast)
term in my formula:
> labels(terms(M))
[1] "error" "scale(forecast)" "error2"
[4] "waste1" "waste2" "sales"
[7] "family" "scale(transactions)" "cluster"
[10] "aweek" "year" "holid_nat"
> ggeffects::ggpredict(M, labels(terms(M)), pretty = T)
`terms` must have not more than three values. Using first three values now.
Error in scale(forecast, center = 276.325019004872, scale = 375.963889410209) :
object 'forecast' not found
The above works just fine with the effects package.
from ggeffects.
Try to standardise the variable before you fit the model, does this work?
from ggeffects.
they are standardized. Sorry, I haven't provided the model formula:
waste ~ error + scale(forecast) + error2 + waste1 + waste2 +
sales + family + scale(transactions) + cluster + aweek +
year + holid_nat
I expect this error has something to do with the inline scale(forecast)
.
from ggeffects.
Yes, please standardize before, and don't use "inline" calls to functions. And it's preferred to use sjmisc::std()
, because scale()
changes the input type.
from ggeffects.
Yes, please standardize before, and don't use "inline" calls to functions.
Yerh, one too many restriction; I guess I would stay away then. All other standard R software works with "inline" functions and doesn't require standardization (effects
package including). But well, every package is different ;)
As a side note, subsampling or pretty=TRUE should be the default. The splines issue is really not an excuse to blow people's R sessions during basic plotting (especially with small data sets).
from ggeffects.
Actually, ggpredict()
should work with the the inline-use of functions, however, the term
-argument must use the original term names. So term = "forecast"
should work, while labels(terms(M))
returns scale(forecast)
.
Your argument is translated to predict(M, newdata = data.frame('scale(forecast)' = ...))
, which causes the error.
from ggeffects.
@emjonaitis and @richardneilbelcher do you still have the memory allocation issues if you set pretty = TRUE
? I think I will indeed make this as default option, and print a message if prettifying was done, so the user is not too curious about less smoothed plots.
from ggeffects.
from ggeffects.
from ggeffects.
I revised the calculation for CI for mixed models, which now should be more efficient. When you now either use:
ggpredict(model, term = "myterm", pretty = TRUE)
or
ggpredict(model, term = "myterm [range]") # should really be "range", this is no placeholder
does one of these two options solve your issue? This requires the current GitHub-version of ggeffects.
from ggeffects.
@vspinu If you want to plot effects for all model terms, you can now simply leave the terms
argument missing or NULL
, so just calling ggeffects::ggpredict(M)
should work, and is comparable (regarding the effort) to allEffects(M)
.
from ggeffects.
I'd be happy if someone who still had problems with memory allocation errors, could check the current GitHub-version. It automatically should calculate a reasonable pretty range of predicted values and should be much more memory efficient when calculating SE/CI for predictions.
from ggeffects.
bump
from ggeffects.
from ggeffects.
No, it's the correct version you are using, either the master branch or the current GitHub version should be more memory efficient.
When you run ggpredict()
, does it display a message about prettifying the values?
from ggeffects.
from ggeffects.
Thanks for looking into this. ggeffect()
calls effects::effect()
, so it might be an issue of the effects package. I'll try to find out where the issue is located.
from ggeffects.
I just realized that ggeffect()
is not optimized, it only applies to ggpredict()
. ggeffect()
was a bit neglected by me, and I was always thinking of ggpredict()
when talking about this issue. 🙄
from ggeffects.
Ok, memory allocation problems with ggeffect()
should also be solved now.
from ggeffects.
from ggeffects.
Related Issues (20)
- 'Tweak' arguments of `plot.ggeffects()` not working HOT 1
- Error with model-averaged phylolm object
- Model averaged models with polynomial terms have no confidence intervals HOT 1
- Error: Unable to compute predicted values with this model. This error can arise when `insight::get_data()` is unable to extract the dataset from the model object HOT 6
- How to get t value of the two-way interaction in linear mixed-effect model? HOT 5
- Predicted proportions below zero for model-averaged binomial GLM HOT 1
- Averaged (marginal) predictions using {marginaleffects}
- missing errors when using fixest models HOT 4
- Colors not showing correctly when specifiying "show_data = T" in the plot method of ggpredict object HOT 1
- ggpredict produces single predicted value for continuous variable HOT 4
- Question about sources of uncertainty when estimatinc confidence intervals HOT 2
- Johnson-Neyman FDR Correction HOT 10
- Relicensing {ggeffects} HOT 5
- Error of ggpredict with glmmPQL HOT 3
- Population-level predictions for gam/comparable predictions for gam and glmer fits HOT 5
- plot a subset for 4-way-interactions HOT 3
- New incompatibilities with emmeans for quantile regression HOT 4
- ggpredict() does not recognise `` quoted response variable with a : symbol in mixed models HOT 1
- "Collapse_group" produces many data points HOT 4
- ggpredict doesn't work for vglm models where multiple.responses = TRUE 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 ggeffects.