unknown error message using gamlj in R

Discuss statistics related things
Post Reply
User avatar
Arnaud Mortier
Posts: 32
Joined: Tue Apr 27, 2021 11:39 am

unknown error message using gamlj in R

Post 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.
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: unknown error message using gamlj in R

Post by jonathon »

update your jmvcore:

remotes::install_github("jamovi/jmvcore")

cheers

jonathon
User avatar
Arnaud Mortier
Posts: 32
Joined: Tue Apr 27, 2021 11:39 am

Re: unknown error message using gamlj in R

Post 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
User avatar
mcfanda@gmail.com
Posts: 457
Joined: Thu Mar 23, 2017 9:24 pm

Re: unknown error message using gamlj in R

Post 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
Post Reply