jmaspons / dSep

Path analysis using d-separation
https://jmaspons.github.io/dSep/
0 stars 0 forks source link

Implement categorical predictors #1

Open abraao-crypto opened 3 years ago

abraao-crypto commented 3 years ago

Hi,

Firstly, I would like to congrats you on this powerful package. I am using the function dSep(x,FUN=MCMCglmm,...) in order to do a path analysis, but unfortunately, I am having this error: Error in parse(text = x, keep.source = FALSE) :

:2:0: unexpected end of input 1: NULL ~ ^ Please, can you help me? All best/ Abraão
jmaspons commented 3 years ago

Thanks for your kind words. Are there any categorical variable in your model? Can you provide a minimum example to reproduce the error?

abraao-crypto commented 3 years ago

Hi. I attached a script, phylogeny, and one dataset.

dSep_Example.zip

Thanks

abraao-crypto commented 3 years ago

Yes , there is only one categorical variable in my model.

Thanks

jmaspons commented 3 years ago

Ok, handling of categorical variables is on the TODO list and the implementation shouldn't be problematic (see https://github.com/jmaspons/dSep/blob/00b899cdbde2aeea14a25780b6c446b4c31a209f/R/D-separation.R#L298), but there is some methodological questions to answer: which p-value to take from the different levels of the categorical predictors? I don't have the answer but if you have references about how to do it, I will happily implement it.

jmaspons commented 3 years ago

Perhaps @AlejandroG-V have some idea about how to handle categorical variables in the d-separation method...

abraao-crypto commented 3 years ago

Ok thanks, I think p-value < 0.05.

Thanks

Em seg, 10 de mai de 2021 07:28, jmaspons @.***> escreveu:

Ok, handling of categorical variables is on the TODO list and the implementation shouldn't be problematic (see

https://github.com/jmaspons/dSep/blob/00b899cdbde2aeea14a25780b6c446b4c31a209f/R/D-separation.R#L298 ), but there is some methodological questions to answer: which p-value to take from the different levels of the categorical predictors? I don't have the answer but if you have references about how to do it, I will happily implement it.

Missatge de abraao-crypto @.***> del dia dj., 6 de maig 2021 a les 0:08:

Yes , there is only one categorical variable in my model.

Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jmaspons/dSep/issues/1#issuecomment-833127612, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAAZB5EJVBVPE7WZ6UR7LIDTMHMWRANCNFSM4364MZJA

.

-- Salut! Joan

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jmaspons/dSep/issues/1#issuecomment-836525901, or unsubscribe https://github.com/notifications/unsubscribe-auth/APQSJCF2ZIWMF5LS5XPC5ETTM6YNXANCNFSM4364MZJA .

jmaspons commented 3 years ago

We need only one p-value and for categorical predictors we get a p-value for each level of the variable - 1 (the reference level has no p-value)