Comments (2)
You can use I()
. Both models are equivalent, according to their predictions:
library(lme4)
library(ggeffects)
data(sleepstudy)
sleepstudy$Var <- sample(1:5, size = 180, replace = T)
fit1 <- lmer(Reaction ~ poly(Days, 2) * Var + (Days | Subject), sleepstudy)
fit2 <- lmer(Reaction ~ Days * Var + I(Days ^ 2) * Var + (Days | Subject), sleepstudy)
predict(fit1)
predict(fit2)
dat <- ggpredict(fit2, terms = c("Days", "Var"))
plot(dat)
The estimates of the models differ (I guess due to "splitting" the interaction term with poly() into two), but the predictions are the same.
Does this solve your issue?
from ggeffects.
Should work now, however, for poly()
or bs()
, your data needs to be in the environment.
from ggeffects.
Related Issues (20)
- 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
- Problem with ggpredict when fixing a parameter value in glmmTMB HOT 2
- ggpredict() returns 90% CI when ppd = TRUE for rstanarm models, but labeled as 95% HOT 1
- Difference between insight::get_predicted and ggeffects::ggpredict when calculating PI
- ggpredict outputs only 6 values at the time HOT 1
- `tinytable` S4 refactor: output formats HOT 5
- Issue with plotting an interaction with a quadratic variable through plot_model from a multi-level and logistic model HOT 2
- hypothesis_test on the lme4 object makes rstudio crash HOT 14
- Prediction intervals from predict_response(type="random") for meta-analysis using nlme
- Errors with new ggeffects version & zero-inflated negative binomial model (glmmTMB) HOT 4
- `data_tabulate()` for crosstables prints NA-proportions when no values are available
- zi_prob-type predictions with new predict_response function HOT 7
- how does test_predictions deal with categorical non-focal terms? HOT 7
- ggeffects capabilities with spatail regression model objects HOT 2
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.