tbates / umx

Making Structural Equation Modeling (SEM) in R quick & powerful
https://tbates.github.io/
44 stars 17 forks source link

More complex, larger graphs causes the coefficients not to be completely printed out #154

Closed lf-araujo closed 3 years ago

lf-araujo commented 3 years ago

Thanks for this package.

In larger paths, the numbers for the coefficients gets cut out and are partially displayed.

corrected-multi-2ifac

So, for example, in the figure above (too tiny to read in github) the path from acp1 to CF1 should read 0.62 (table below), instead of 62. This happens throughout the plot.

Table S11: Common Factor Paths

A C E
Common.factor.1 0.62 0.78 0.01
Common.factor.2 0.10 0.10 0.00

My system:

R version 4.0.4 (2021-02-15)
Platform: x86_64-solus-linux-gnu (64-bit)
Running under: Solus 4.2 Fortitude

Matrix products: default
BLAS/LAPACK: /usr/lib64/haswell/libopenblas_haswellp-r0.3.13.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=pt_BR.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=pt_BR.UTF-8   
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=pt_BR.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=pt_BR.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] knitr_1.31             umx_4.3.0              OpenMx_2.18.1          forcats_0.5.1          stringr_1.4.0          dplyr_1.0.4           
 [7] purrr_0.3.4            readr_1.4.0            tidyr_1.1.2            tibble_3.1.0           tidyverse_1.3.0        ggplot2_3.3.3         
[13] naniar_0.6.0           visdat_0.5.3           here_1.0.1             ProjectTemplate_0.10.1 rmarkdown_2.7          nvimcom_0.9-82        

loaded via a namespace (and not attached):
 [1] nlme_3.1-152       fs_1.5.0           lubridate_1.7.10   webshot_0.5.2      RColorBrewer_1.1-2 httr_1.4.2         rprojroot_2.0.2    DiagrammeRsvg_0.1 
 [9] tools_4.0.4        backports_1.2.1    utf8_1.1.4         R6_2.5.0           DBI_1.1.1          colorspace_2.0-0   withr_2.4.1        tidyselect_1.1.0  
[17] curl_4.3           compiler_4.0.4     polycor_0.7-10     cli_2.3.1          rvest_0.3.6        xml2_1.3.2         scales_1.1.1       checkmate_2.0.0   
[25] systemfonts_1.0.1  digest_0.6.27      foreign_0.8-81     svglite_2.0.0      base64enc_0.1-3    pkgconfig_2.0.3    htmltools_0.5.1.1  MuMIn_1.43.17     
[33] highr_0.8          dbplyr_2.1.0       htmlwidgets_1.5.3  rlang_0.4.10       readxl_1.3.1       rstudioapi_0.13    visNetwork_2.0.9   generics_0.1.0    
[41] jsonlite_1.7.2     magrittr_2.0.1     kableExtra_1.3.4   Matrix_1.3-2       Rcpp_1.0.6         munsell_0.5.0      fansi_0.4.2        lifecycle_1.0.0   
[49] stringi_1.5.3      yaml_2.2.1         MASS_7.3-53        grid_4.0.4         parallel_4.0.4     crayon_1.4.1       lattice_0.20-41    haven_2.3.1       
[57] cowplot_1.1.1      hms_1.0.0          ps_1.6.0           pillar_1.5.0       stats4_4.0.4       reprex_1.0.0       glue_1.4.2         evaluate_0.14     
[65] V8_3.4.0           modelr_0.1.8       vctrs_0.3.6        cellranger_1.1.0   gtable_0.3.0       assertthat_0.2.1   xfun_0.21          xtable_1.8-4      
[73] broom_0.7.5        rsvg_2.1           viridisLite_0.3.0  DiagrammeR_1.0.6.1 ellipsis_0.3.1  

Cheers,

Luis

tbates commented 3 years ago

hi luis, umx plot can optionally strip the leading zero. That's by design to improve clarity in the dot plot. I think the default for that is on for twin models (which are messy and can use the space saved by omitting "0." in dozens of locations. You can experiment with plot(m1, strip_zero = FALSE) with your model - let me know if that's the issue?

lf-araujo commented 3 years ago

I guess this is it. Thanks!

I suspected, but couldn't locate the info in the documentation.