strengejacke / sjPlot

sjPlot - Data Visualization for Statistics in Social Science
https://strengejacke.github.io/sjPlot
608 stars 92 forks source link

Clmm support in tab_model() broken by recent update #570

Closed JCruk closed 4 years ago

JCruk commented 4 years ago

tab_model() is failing with clmm objects with a different error than previously reported (and fixed) in this issue.

I am getting:

Error in match.arg(method, choices = c("default", "refit", "posthoc",  : 
  'arg' must be NULL or a character vector

plot_model() is still working fine.

I have the following versions installed:

sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] sjPlot_2.7.2      ordinal_2019.4-25

loaded via a namespace (and not attached):
 [1] tidyselect_0.2.5    sjlabelled_1.1.1    xfun_0.10           performance_0.4.0.1
 [5] purrr_0.3.3         splines_3.6.1       haven_2.1.1         lattice_0.20-38    
 [9] parameters_0.3.0    colorspace_1.4-1    vctrs_0.2.0         generics_0.0.2     
[13] yaml_2.2.0          rlang_0.4.1         pillar_1.4.2        nloptr_1.2.1       
[17] foreign_0.8-72      glue_1.3.1          effectsize_0.0.1    modelr_0.1.5       
[21] emmeans_1.4.2       lifecycle_0.1.0     sjmisc_2.8.2        munsell_0.5.0      
[25] gtable_0.3.0        bayestestR_0.4.0    mvtnorm_1.0-11      coda_0.19-3        
[29] psych_1.8.12        knitr_1.25          forcats_0.4.0       parallel_3.6.1     
[33] broom_0.5.2         Rcpp_1.0.2          xtable_1.8-4        backports_1.1.5    
[37] scales_1.0.0        ggeffects_0.12.0    lme4_1.1-21         mnormt_1.5-5       
[41] ggplot2_3.2.1       hms_0.5.2           insight_0.7.0       dplyr_0.8.3        
[45] ggrepel_0.8.1       numDeriv_2016.8-1.1 grid_3.6.1          sjstats_0.17.6     
[49] tools_3.6.1         magrittr_1.5        lazyeval_0.2.2      tibble_2.1.3       
[53] ucminf_1.1-4        crayon_1.3.4        tidyr_1.0.0         pkgconfig_2.0.3    
[57] zeallot_0.1.0       MASS_7.3-51.4       Matrix_1.2-17       estimability_1.3   
[61] assertthat_0.2.1    minqa_1.2.4         rstudioapi_0.10     R6_2.4.0           
[65] boot_1.3-23         nlme_3.1-141        compiler_3.6.1     

The error can be reproduced with:

library(ordinal)
library(sjPlot)

data(wine, package = "ordinal")
data(soup)

m1 <- clmm(rating ~ temp + contact + (1 | judge), data = wine)
m2 <- clmm(SURENESS ~ PROD + (1 | RESP) + (1 | RESP:PROD),
           data = soup,
           link = "probit",
           threshold = "equidistant"
)

tab_model(m1, m2)
Error in match.arg(method, choices = c("default", "refit", "posthoc",  : 
  'arg' must be NULL or a character vector
strengejacke commented 4 years ago

Works fine for me. I guess you need to install effectsize from CRAN and then update sjPlot from CRAN, then it should work (usually, pkg effectsize will be automatically installed once you update sjPlot).

JCruk commented 4 years ago

Installing effectsize and sjPlot from CRAN fixed the issue for me. Thanks!