Page 1 of 1

unknown error message using gamlj in R

Posted: Sat May 01, 2021 10:53 pm
by Arnaud Mortier
Hi,

I need to be able to run mixed data count analyses directly in R, so I installed gamlj via

Code: Select all

devtools::install_github("gamlj/gamlj")
and then copy-pasted the code given by jamovi in R syntax mode, namely:

Code: Select all

gamlj::gamljGlmMixed(formula = mes ~ 1 + tps + gr +tps:gr+( 1 | part ),
+                      data = g,
+                      modelSelection = "nb")
It outputs the error message
Error: 'OptionOutput' is not an exported object from 'namespace:jmvcore'
Google is of no help to find out what this means.
I have checked on a simpler model (one way ANOVA) that the code displayed by jamovi in syntax mode works as such, so the problem seems to come from gamlj itself.

I have R version 4.0.5.

Thank you for any ideas.

Re: unknown error message using gamlj in R

Posted: Sun May 02, 2021 8:14 am
by jonathon
update your jmvcore:

remotes::install_github("jamovi/jmvcore")

cheers

jonathon

Re: unknown error message using gamlj in R

Posted: Sun May 02, 2021 10:11 am
by Arnaud Mortier
Thanks for your answer!

Now the analysis will try to run, but it treats the factors as covariates and thus insists that I make them numeric:
Error: Covariate tps cannot be converted to a numeric variable
In addition: Warning message:
In mf.checkData(self$options, data, modelType = modelType) :
NAs introduced by coercion
If I make the factors numeric beforehand, then the analysis does run, but of course it is not the analysis I want.

Edit : sorry, I got that one, you actually need to manually turn variables into factors if you want them treated as such.
I understood this thanks to viewtopic.php?f=2&t=1419

Thanks for your help!

Cheers
Arnaud

Re: unknown error message using gamlj in R

Posted: Sun May 02, 2021 1:13 pm
by mcfanda@gmail.com
Hi,
yes, that's a feature we intended to have. In R, gamlj treats variables as defined by their class. So, if you want an IV to be treated as a factor, you should make them a factor beforehand. The DV, however, is coerced to the appropriate class, if possible