Page 1 of 1

gamlj error when reproducing in Rstudio

Posted: Fri Sep 11, 2020 11:58 pm
by rjs
Hi there, first posting;

I am trying to re-run code generated by the GAMLJ module (in Jamovi) in Rstudio and am getting a consistent error (i.e., using both a GLM and a mixed model approach) while executing exported code:

"Error: Argument 'covs' requires a numeric variable ('some_factor' is not valid)" See mockup of actual code exported below:

gamlj::gamljGLM(
formula = `dependent_variable` ~ `some_factor` * `another_factor` * `a_third_factor`,
data = data)

I installed the gamlj package and ran above code. This error seems odd to me as I am using a formula, and according to GAMLJ package descriptions, 'covs' is not required when using a formula?

Any idea what this error may be referring to? Adding "covs=NULL" for example doesn't help.

Thanks for any insight, RJS

Re: gamlj error when reproducing in Rstudio

Posted: Sat Sep 12, 2020 12:22 am
by jonathon
hi,

i think we'll need a reproducible example to understand what's going on here.

i've just done a quick test on the ToothGrowth data set, and it works:

gamlj::gamljGLM(ToothGrowth, formula=len~dose*supp)

so there's something unexpected about your data.

cheers

jonathon

Re: gamlj error when reproducing in Rstudio

Posted: Sat Sep 12, 2020 1:12 am
by rjs
Gotcha. I will have a look and get back to you.

Re: gamlj error when reproducing in Rstudio

Posted: Sat Sep 12, 2020 2:30 am
by rjs
Ok I figured this out. Rstudio did not recognize my "some_factor" for a factor properly. Once I told her it was a factor indeed, all worked well. I suppose gamljGLM() does the checking in the background. Thanks!
-RJS