hfgolino / EGAnet

43 stars 9 forks source link

EGA with correlation matrix fails #20

Closed DominiqueMakowski closed 4 years ago

DominiqueMakowski commented 5 years ago

Hey @hfgolino, thanks for the package.

It seems that EGA won't accept a correlation matrix as input. Am I missing something?

EGAnet::EGA(cor(mtcars), n = nrow(mtcars))
#> Error in EGAnet::EGA(cor(mtcars), n = nrow(mtcars)): object 'n.dim.sim' not found

Created on 2019-06-19 by the reprex package (v0.3.0)

hfgolino commented 5 years ago

Hi Dominique, this is a bug I'll solve in the next few days. I'll update the package on GitHub soon.

Could you, please, contact me again in one or two weeks to confirm if the package is updated? Best,

Hudson

Hudson Golino Assistant Professor Department of Psychology

E hfg9s@eservices.virginia.edu P 434.806.1915

University of Virginia 1023 Millmont St, Office 115 Charlottesville, VA 22903

Em qua, 19 de jun de 2019 às 17:07, Dominique Makowski < notifications@github.com> escreveu:

Hey @hfgolino https://github.com/hfgolino, thanks for the package.

It seems that EGA won't accept a correlation matrix as input. Am I missing something?

EGAnet::EGA(cor(mtcars), n = nrow(mtcars))#> Error in EGAnet::EGA(cor(mtcars), n = nrow(mtcars)): object 'n.dim.sim' not found

Created on 2019-06-19 by the reprex package https://reprex.tidyverse.org (v0.3.0)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hfgolino/EGAnet/issues/20?email_source=notifications&email_token=ABFLKG4JZFENFMJ7DMJPCSDP3JDURA5CNFSM4HZKTGB2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2NSHMA, or mute the thread https://github.com/notifications/unsubscribe-auth/ABFLKG4MYPYQK2BFWKML6KDP3JDURANCNFSM4HZKTGBQ .

DominiqueMakowski commented 5 years ago

@hfgolino Sure, thanks ;)

hfgolino commented 4 years ago

EGA is working well with correlation matrices.

Psych-MaXu commented 5 months ago

Hey @hfgolino, thanks for the package. I still have this bug. i first used the bootnet package, and run this script "Net1 <- estimateNetwork(data = data4[,4:25],default = 'IsingFit')". Then I take the matrix to a new variable, the script is that "matrix1 <- Net1$results$weiadj". Finally, i found this script "EGAnet::EGA(matrix1, n = 3934)" did not work. is there something worng?

AlexChristensen commented 5 months ago

Hi @Psych-MaXu,

Please see: https://r-ega.net/articles/modular-approach.html

Also, please read the documentation as it does not say that a network can be input into EGA, so the function is working as expected: https://r-ega.net/reference/EGA.html

Finally, it is not recommended to use an Ising model network with community detection algorithms. The log of the odds-ratio weights are not suitable for community detection algorithms.