Comments (3)
I cannot reproduce your example, the model gives an error:
library(mclogit)
#> Loading required package: Matrix
library(ggeffects)
db.example <- structure(list(dep_resultado_academico = structure(c(3L, 2L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 3L, 1L, 1L,
3L, 2L, 2L, 2L, 2L, 3L, 2L, 2L, 2L, 3L, 3L, 2L, 2L, 2L, 1L, 2L,
3L, 2L, 2L, 2L, 3L, 1L), .Label = c("Cursando", "Graduado", "Evasão"
), class = "factor"), faixa_idade = structure(c(3L, 2L, 2L, 3L,
1L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 1L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 2L, 2L, 3L, 2L, 2L, 1L, 3L,
2L, 2L, 1L, 1L), .Label = c("Até 18 anos", "Entre 19 e 24 anos",
"Entre 25 e 29 anos", "30 anos ou mais"), class = "factor"),
SEXO = structure(c(1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 2L,
1L, 1L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L,
1L, 1L, 2L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L
), .Label = c("Masculino", "Feminino"), class = "factor"),
CURSO_ATUAL = structure(c(1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 1L, 1L, 1L, 1L, 2L, 3L, 3L, 2L, 4L, 5L, 5L, 5L, 5L, 6L,
6L, 6L, 7L, 8L, 4L, 9L, 5L, 5L, 5L, 1L, 1L, 1L, 10L, 10L,
9L, 9L, 9L), .Label = c("Letras", "Medicina", "Engenharia Química",
"Pedagogia", "Direito", "Enfermagem", "Engenharia Civil",
"Engenharia Mecânica", "Psicologia", "Geografia", "Odontologia",
"Educação Física", "Administração", "Engenharia Elétrica",
"Geologia", "Ciências Biológicas", "Comunicação Social",
"Arquitetura e Urbanismo", "Engenharia de Produção", "Artes Visuais",
"Biblioteconomia", "História", "Farmácia", "Filosofia", "Medicina Veterinária",
"Matemática", "Ciências Contábeis", "Engenharia de Minas",
"Química", "Física", "Ciências Sociais", "Engenharia de Controle e Automação",
"Ciências Econômicas", "Engenharia Metalúrgica", "Fisioterapia",
"Terapia Ocupacional", "Fonoaudiologia", "Turismo", "Nutrição",
"Ciência da Computação", "Ciências Atuariais", "Estatística",
"Sistemas de Informação"), class = "factor")), row.names = c(NA,
-40L), class = c("tbl_df", "tbl", "data.frame"))
model.example <- mblogit(dep_resultado_academico ~ faixa_idade + SEXO,
data = db.example,
random = c(~1|CURSO_ATUAL),
method = "MQL",
estimator = "REML",
maxit = 20)
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 1 - deviance = 109.3839 - criterion = 1.033022
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 2 - deviance = 120.908 - criterion = 0.1304513
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 3 - deviance = 119.6012 - criterion = 0.04783325
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 4 - deviance = 119.6994 - criterion = 0.03275368
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 5 - deviance = 119.7083 - criterion = 0.02436854
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 6 - deviance = 119.6681 - criterion = 0.01883837
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 7 - deviance = 119.684 - criterion = 0.01487719
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 8 - deviance = 119.6689 - criterion = 0.0120209
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 9 - deviance = 119.6765 - criterion = 0.009879401
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 10 - deviance = 119.6706 - criterion = 0.008252256
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 11 - deviance = 119.674 - criterion = 0.006984561
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 12 - deviance = 119.6716 - criterion = 0.005983284
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 13 - deviance = 119.6731 - criterion = 0.005178449
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 14 - deviance = 119.6721 - criterion = 0.004523611
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 15 - deviance = 119.6728 - criterion = 0.003981716
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 16 - deviance = 119.6723 - criterion = 0.003526526
#> Error in .solve.checkCond(a, tol): 'a' is computationally singular, rcond(a)=1.0131e-16
summary(model.example)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'object' in selecting a method for function 'summary': object 'model.example' not found
Created on 2023-08-30 with reprex v2.0.2
from ggeffects.
Hi Daniel.
I tested again here and the model worked, strange. What can I do to help?
I'm using the lastest version of mclogit()
and ggeffects()
.
mclogit()
gives the warning that the algorithm did not converge here, but it works, and when I try to use ggeffects()
the problem persists.
library(mclogit)
#> Loading required package: Matrix
library(ggeffects)
db.example <- structure(list(dep_resultado_academico = structure(c(3L, 2L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 3L, 1L, 1L,
3L, 2L, 2L, 2L, 2L, 3L, 2L, 2L, 2L, 3L, 3L, 2L, 2L, 2L, 1L, 2L,
3L, 2L, 2L, 2L, 3L, 1L), .Label = c("Cursando", "Graduado", "Evasão"
), class = "factor"), faixa_idade = structure(c(3L, 2L, 2L, 3L,
1L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 1L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 2L, 2L, 3L, 2L, 2L, 1L, 3L,
2L, 2L, 1L, 1L), .Label = c("Até 18 anos", "Entre 19 e 24 anos",
"Entre 25 e 29 anos", "30 anos ou mais"), class = "factor"),
SEXO = structure(c(1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 2L,
1L, 1L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L,
1L, 1L, 2L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L
), .Label = c("Masculino", "Feminino"), class = "factor"),
CURSO_ATUAL = structure(c(1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 1L, 1L, 1L, 1L, 2L, 3L, 3L, 2L, 4L, 5L, 5L, 5L, 5L, 6L,
6L, 6L, 7L, 8L, 4L, 9L, 5L, 5L, 5L, 1L, 1L, 1L, 10L, 10L,
9L, 9L, 9L), .Label = c("Letras", "Medicina", "Engenharia Química",
"Pedagogia", "Direito", "Enfermagem", "Engenharia Civil",
"Engenharia Mecânica", "Psicologia", "Geografia", "Odontologia",
"Educação Física", "Administração", "Engenharia Elétrica",
"Geologia", "Ciências Biológicas", "Comunicação Social",
"Arquitetura e Urbanismo", "Engenharia de Produção", "Artes Visuais",
"Biblioteconomia", "História", "Farmácia", "Filosofia", "Medicina Veterinária",
"Matemática", "Ciências Contábeis", "Engenharia de Minas",
"Química", "Física", "Ciências Sociais", "Engenharia de Controle e Automação",
"Ciências Econômicas", "Engenharia Metalúrgica", "Fisioterapia",
"Terapia Ocupacional", "Fonoaudiologia", "Turismo", "Nutrição",
"Ciência da Computação", "Ciências Atuariais", "Estatística",
"Sistemas de Informação"), class = "factor")), row.names = c(NA,
-40L), class = c("tbl_df", "tbl", "data.frame"))
model.example <- mblogit(dep_resultado_academico ~ faixa_idade + SEXO,
data = db.example,
random = c(~1|CURSO_ATUAL),
method = "MQL",
estimator = "REML",
maxit = 20)
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 1 - deviance = 109.3839 - criterion = 1.033022
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 2 - deviance = 120.908 - criterion = 0.1304513
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 3 - deviance = 119.6012 - criterion = 0.04783325
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 4 - deviance = 119.6994 - criterion = 0.03275368
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 5 - deviance = 119.7083 - criterion = 0.02436854
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 6 - deviance = 119.6681 - criterion = 0.01883837
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 7 - deviance = 119.684 - criterion = 0.01487719
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 8 - deviance = 119.6689 - criterion = 0.0120209
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 9 - deviance = 119.6765 - criterion = 0.009879401
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 10 - deviance = 119.6706 - criterion = 0.008252256
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 11 - deviance = 119.674 - criterion = 0.006984559
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 12 - deviance = 119.6716 - criterion = 0.005983286
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 13 - deviance = 119.6731 - criterion = 0.005178275
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 14 - deviance = 119.6721 - criterion = 0.004523205
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 15 - deviance = 119.6728 - criterion = 0.003982371
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 16 - deviance = 119.6723 - criterion = 0.003511752
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 17 - deviance = 119.6726 - criterion = 0.003164549
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 18 - deviance = 119.6724 - criterion = 0.002484265
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 19 - deviance = 119.6725 - criterion = 0.001902648
#> Warning: Inner iterations did not coverge - nlminb message: false convergence
#> (8)
#>
#> Iteration 20 - deviance = 119.6725 - criterion = 0.0006252818
#> Warning: Algorithm did not converge
#> Warning: Fitted probabilities numerically 0 or 1 occurred
ggeffect(model.example)
#> Can't compute marginal effects, `effects::Effect()` returned an error.
#>
#> Reason: unused argument (qr = TRUE)
#> You may try `ggpredict()` or `ggemmeans()`.
#>
#> Can't compute marginal effects, `effects::Effect()` returned an error.
#>
#> Reason: unused argument (qr = TRUE)
#> You may try `ggpredict()` or `ggemmeans()`.
#> NULL
Created on 2023-08-30 with [reprex v2.0.2](https://reprex.tidyverse.org/)
from ggeffects.
Can you save the model object (in RData or RDS format), zip it and attach it to this issue?
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
- Plotting ordinal logistic predicted effects on latent scale of ordinal outcome? HOT 3
- 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.