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?
Predict function with gamlj LM
Re: Predict function with gamlj LM
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
Anyone coming across this post making the same mistake just see here:
https://rdrr.io/github/gamlj/gamlj/man/ ... edict.html
Re: Predict function with gamlj LM
ah, marcello might want to think about using S3 dispatch for this!
jonathon
jonathon
- mcfanda@gmail.com
- Posts: 462
- Joined: Thu Mar 23, 2017 9:24 pm
Re: Predict function with gamlj LM
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