Comments (3)
You're talking about something like these two different type of plots?
library(effects)
#> Loading required package: carData
#> lattice theme set by effectsTheme()
#> See ?effectsTheme for details.
library(MASS)
options(contrasts = c("contr.treatment", "contr.poly"))
m <- polr(Sat ~ Infl + Type + Cont, weights = Freq, data = housing)
plot(effects::Effect(c("Infl", "Type"), m, latent = TRUE))
#>
#> Re-fitting to get Hessian
plot(effects::Effect(c("Infl", "Type"), m, latent = FALSE))
#>
#> Re-fitting to get Hessian
Created on 2024-04-29 with reprex v2.1.0
from ggeffects.
In this particular case, there's no predict()
type to get the predictions on the latent scale. I must check how to achieve this using emmeans or marginaleffects, so I could make this available for these options in ggeffects (i.e. ggemmeans()
and ggaverage()
). And I must check how other packages handle predict()
, like ordinal::clm()
, and their options with emmeans or marginaleffects.
from ggeffects.
Ok, this is the current progress. Works for ggeffect()
only at the moment.
library(ggeffects)
library(effects)
#> Loading required package: carData
#> lattice theme set by effectsTheme()
#> See ?effectsTheme for details.
library(MASS)
options(contrasts = c("contr.treatment", "contr.poly"))
m <- polr(Sat ~ Infl + Type + Cont, weights = Freq, data = housing)
ggeffect(m, c("Infl", "Type"), latent = TRUE)
#> # Predicted log-odds of Sat
#>
#> Type: Tower
#>
#> Infl | Predicted | 95% CI
#> ---------------------------------
#> Low | 0.18 | 0.09, 0.27
#> Medium | 0.75 | 0.52, 0.98
#> High | 1.47 | 1.19, 1.75
#>
#> Type: Apartment
#>
#> Infl | Predicted | 95% CI
#> ---------------------------------
#> Low | -0.39 | -0.63, -0.15
#> Medium | 0.17 | -0.14, 0.49
#> High | 0.90 | 0.55, 1.24
#>
#> Type: Atrium
#>
#> Infl | Predicted | 95% CI
#> ---------------------------------
#> Low | -0.19 | -0.49, 0.12
#> Medium | 0.38 | 0.01, 0.76
#> High | 1.10 | 0.71, 1.50
#>
#> Type: Terrace
#>
#> Infl | Predicted | 95% CI
#> ---------------------------------
#> Low | -0.91 | -1.21, -0.61
#> Medium | -0.34 | -0.71, 0.02
#> High | 0.38 | -0.02, 0.77
effects::Effect(c("Infl", "Type"), m, latent = TRUE)
#>
#> Re-fitting to get Hessian
#>
#> Infl*Type effect
#> Type
#> Infl Tower Apartment Atrium Terrace
#> Low 0.1801421 -0.3922081 -0.1860445 -0.9108728
#> Medium 0.7465358 0.1741857 0.3803492 -0.3444791
#> High 1.4689611 0.8966110 1.1027746 0.3779462
#>
#> Thresholds:
#> Low|Medium Medium|High
#> -0.4961353 0.6907083
ggeffect(m, c("Infl", "Type"), latent = TRUE) |> plot()
effects::Effect(c("Infl", "Type"), m, latent = TRUE) |> plot()
#>
#> Re-fitting to get Hessian
Created on 2024-04-30 with reprex v2.1.0
from ggeffects.
Related Issues (20)
- 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
- Error when specifying focal terms in ggeffect() HOT 2
- Wrong labels for `test_prediction()` with `margin`. HOT 1
- Fix printing issue with cleaning values
- r ggeffect random sample linear spline HOT 1
- Bug in order of comparisons / labels when character vector is used in model
- test_predictions not working with gamm4 model output HOT 4
- predict_response removes unobserved dv levels from clmm? HOT 3
- earth (MARS) support HOT 1
- reference issue in "Introduction_randomeffects.Rmd"
- plot add data=TRUE not making sense HOT 6
- Error: Objects of class `ggeffects` are not yet supported. HOT 5
- "Could not find model object to extract residuals." fails with a pipe HOT 4
- Curvilinear interaction is significant, then how do I get the significances of the linear term and quadratic term of the focal variable at the +1SD, mean, -SD points of moderator? HOT 7
- Problems with predictions from "robustbase" package ("hypothesis_test") 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.