-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem using ggeffects for mclogit package #352
Comments
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 |
Hi Daniel. I tested again here and the model worked, strange. What can I do to help? I'm using the lastest version of
|
Can you save the model object (in RData or RDS format), zip it and attach it to this issue? |
Currently trying to use
ggeffects
for ammblogit
object from themclogit
package, but the following messages are being shown:Here is a reprex from the database and the model. I'm using the uptaded versions of both packages. Note: the model converge in the complete dataset and model, and this happens using PQL or MQL method.
Created on 2023-07-27 with reprex v2.0.2
Session info
The text was updated successfully, but these errors were encountered: