Error when running mixed model in GAMLj

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)
dskvarc
Posts: 10
Joined: Wed Feb 12, 2020 5:25 am

Error when running mixed model in GAMLj

Post by dskvarc »

Hi Jonathon and co,
Thank you and your team for providing such an excellent software package! It's really cool and intuitive.

I'm having some trouble trying to run a linear mixed model in GAMLj, I get an error stating that "object 'mePredDCreate' not found" and the analysis does not run. Everything else seems to work perfectly fine from what I can tell.

Speaking with some colleagues who are all using the same software, we've identified all of us with a similar institutional build computer (Windows 10, OS version 1809) get the same error. My colleagues with older machines (Windows 10 1709) can run the analysis perfectly without any issue.

Is this something that you have seen before?


Cheers,
Dave
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Error when running mixed model in GAMLj

Post by jonathon »

hi,

can you attach a .omv file containing the error?

with thanks
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Error when running mixed model in GAMLj

Post by jonathon »

is that 'mePredDCreate' or 'merPredDCreate'?
User avatar
mcfanda@gmail.com
Posts: 457
Joined: Thu Mar 23, 2017 9:24 pm

Re: Error when running mixed model in GAMLj

Post by mcfanda@gmail.com »

Hi
we just upgraded GAMLj to version 2.0.3. Could you please update and check if the problem persists?
thanks
dskvarc
Posts: 10
Joined: Wed Feb 12, 2020 5:25 am

Re: Error when running mixed model in GAMLj

Post by dskvarc »

Hi Jonathon and Marcello,
Thank you both for your speedy replies! I have uploaded my omv file.
And apologies, yes, the error was "object 'merPredDCreate' not found".

Marcello, I have now updated GAMLj, but the error persists.



Cheers,
Dave
Attachments
wicksell-gamlj error.omv
(6.08 KiB) Downloaded 335 times
User avatar
mcfanda@gmail.com
Posts: 457
Joined: Thu Mar 23, 2017 9:24 pm

Re: Error when running mixed model in GAMLj

Post by mcfanda@gmail.com »

Hi
it may be a problem with the underlying lme4 R package. To be sure, may I ask you to install jamovi module `Rj` and run this code. So we can check what is going on.

Code: Select all


formula = dv ~ 1 + time + group + time:group+( 1 | subj )
gamlj::gamljMixed(
    formula = formula,
    data = data)
    
library(lmerTest)
mod<-lmer(formula,data=data)
summary(mod)
pr<-predict(mod)
length(pr)

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

Re: Error when running mixed model in GAMLj

Post by mcfanda@gmail.com »

This should be run after opening the .omv you sent us
dskvarc
Posts: 10
Joined: Wed Feb 12, 2020 5:25 am

Re: Error when running mixed model in GAMLj

Post by dskvarc »

Hi Marcello,
Here is the output from the code:

Debug

Error in loadNamespace(name): there is no package called 'gamlj'

private$.run()
eval(code, self$data, echo, self$results, figWidth = figWidth, figHeight = figHeight)
evaluate::evaluate(input = script, envir = eval.env, output_handler = handler, stop_on_error = 2)
evaluate_call(expr, parsed$src[], envir = envir, enclos = enclos, debug = debug, last = i == length(out), use_try = stop_on_error != 2, keep_warning = keep_warning, keep_message = keep_message, output_handler = output_handler, include_timing = include_timing)
timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, error = eHandler, message = mHandler))
withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)
withVisible(eval(expr, envir, enclos))
eval(expr, envir, enclos)
eval(expr, envir, enclos)
gamlj::gamljMixed
getExportedValue(pkg, name)
asNamespace(ns)
getNamespace(ns)
loadNamespace(name)
withRestarts(stop(cond), retry_loadNamespace = function() NULL)
withOneRestart(expr, restarts[[1]])
doWithOneRestart(return(expr), restart)


Cheers,
Dave
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Error when running mixed model in GAMLj

Post by jonathon »

hey dave,

try just these lines:

library(lmerTest)
formula = dv ~ 1 + time + group + time:group+( 1 | subj )
mod<-lmer(formula,data=data)
summary(mod)
pr<-predict(mod)
length(pr)

(in order for the gamlj line to work, you'll need to be using system R, and have gamlj installed into R ... let's just try the above lines for now).

cheers
dskvarc
Posts: 10
Joined: Wed Feb 12, 2020 5:25 am

Re: Error when running mixed model in GAMLj

Post by dskvarc »

Hi Jonathon,
Here is the output from the code:

Debug

Error: object of type 'closure' is not subsettable

private$.run()
eval(code, self$data, echo, self$results, figWidth = figWidth, figHeight = figHeight)
evaluate::evaluate(input = script, envir = eval.env, output_handler = handler, stop_on_error = 2)
evaluate_call(expr, parsed$src[], envir = envir, enclos = enclos, debug = debug, last = i == length(out), use_try = stop_on_error != 2, keep_warning = keep_warning, keep_message = keep_message, output_handler = output_handler, include_timing = include_timing)
timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, error = eHandler, message = mHandler))
withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)
withVisible(eval(expr, envir, enclos))
eval(expr, envir, enclos)
eval(expr, envir, enclos)
lmer(formula, data = data)
eval.parent(mc)
eval(expr, p)
eval(expr, p)
lme4::lmer(formula = formula, data = data)
eval(mc, parent.frame(1))
eval(mc, parent.frame(1))
lme4::lFormula(formula = formula, data = data, control = list(optimizer = "nloptwrap", restart_edge = TRUE, boundary.tol = 1e-05, calc.derivs = TRUE, use.last.params = FALSE, checkControl = list(check.nobs.vs.rankZ = "ignore", check.nobs.vs.nlev = "stop", check.nlev.gtreq.5 = "ignore", check.nlev.gtr.1 = "stop", check.nobs.vs.nRE = "stop", check.rankX = "message+drop.cols", check.scaleX = "warning", check.formula.LHS = "stop"), checkConv = list(check.conv.grad = list(action = "warning", tol = 0.002,
relTol = NULL), check.conv.singular = list(action = "message", tol = 1e-04), check.conv.hess = list(action = "warning", tol = 1e-06)), optCtrl = list()))
checkFormulaData(formula, data, checkLHS = control$check.formula.LHS == "stop")
stopifnot(!checkLHS || length(as.formula(formula, env = denv)) == 3)
as.formula(formula, env = denv)
formula(object, env = baseenv())
formula.default(object, env = baseenv())
notnull(x$formula)


--

Thanks again to you both!

Cheers,
Dave
Post Reply