Predict function with gamlj LM

General help and assistance with jamovi. Bug reports can be made at our issues page: https://github.com/jamovi/jamovi/issues . (If you're unsure feel free to discuss it here)
Post Reply
Whirly123
Posts: 31
Joined: Mon May 06, 2019 3:07 pm

Predict function with gamlj LM

Post by Whirly123 »

I am running the predict function on some linear models but it doesn't seem to work with models generated by gamlj (although I am probably doing something wrong).

I can generate a model with lmer and run:
predict(LmerModel1, data) and it works fine.

If I generate the same model in gamlj and run predict:
predict(GamljModel$model, data) I get this error:

Error in eval(predvars, data, env) : object 'XQWdlbnRUeXBl' not found

That weird string is because inside the GamljModel the in lm equation everything has been renamed to random strings:
"XUmF0aW5n ~ 1 + XQWdlbnRUeXBl+( 1 + XQWdlbnRUeXBl | XUmVzcG9uc2VJZA )"

Obviously this is not the way I should be going about it.

What should I be doing?
Whirly123
Posts: 31
Joined: Mon May 06, 2019 3:07 pm

Re: Predict function with gamlj LM

Post by Whirly123 »

Nevermind, I was being dumb not realising Gamlj has its own predict function.

Anyone coming across this post making the same mistake just see here:
https://rdrr.io/github/gamlj/gamlj/man/ ... edict.html
User avatar
jonathon
Posts: 2625
Joined: Fri Jan 27, 2017 10:04 am

Re: Predict function with gamlj LM

Post by jonathon »

ah, marcello might want to think about using S3 dispatch for this!

jonathon
User avatar
mcfanda@gmail.com
Posts: 462
Joined: Thu Mar 23, 2017 9:24 pm

Re: Predict function with gamlj LM

Post by mcfanda@gmail.com »

Whirly123, yes at the moment you need to use the gamlj method, but in the next version I will implement the S3 dispatch method, so one can use predict() also for gamlj results
Post Reply