@Ara_Winter than you for your help. Below is the code:
imp ← mice(dat, m = 5, print = FALSE)
Then check and set the priors
get_prior(Choice1 ~ 1 + Randomization + Phase + Session + RandomizationConditionPhase + (1 | ID),
data = temp1,
family=categorical(link = “logit”),
prior = priors
)
priors ← c(prior(student_t(3, 1.5, 10), class = “Intercept”, dpar = “mu1”),
prior(student_t(3, .5, 10), class = “Intercept”, dpar = “mu2”),
prior(normal(0,5), class = “b”, coef = “ConditionPlatable”, dpar = “mu1”),
prior(normal(0,5), class = “b”, coef = “PhaseExtinction”, dpar = “mu1”),
prior(normal(0,5), class = “b”, coef = “PhaseExtinction:ConditionPlatable”, dpar = “mu1”),
prior(normal(0,5), class = “b”, coef = “RandomizationB”, dpar = “mu1”),
prior(normal(0,5), class = “b”, coef = “RandomizationB:ConditionPlatable”, dpar = “mu1”),
prior(normal(0,5), class = “b”, coef = “RandomizationB:PhaseExtinction”, dpar = “mu1”),
prior(normal(0,5), class = “b”, coef = “RandomizationB:PhaseExtinction:ConditionPlatable”, dpar =“mu1”),
prior(normal(0,5), class = “b”, coef = “SessionPostMTx”, dpar =“mu1”),
prior(normal(0,5), class = “b”, coef = “ConditionPlatable”, dpar = “mu2”),
prior(normal(0,5), class = “b”, coef = “PhaseExtinction”, dpar = “mu2”),
prior(normal(0,5), class = “b”, coef = “PhaseExtinction:ConditionPlatable”, dpar = “mu2”),
prior(normal(0,5), class = “b”, coef = “RandomizationB”, dpar = “mu2”),
prior(normal(0,5), class = “b”, coef = “RandomizationB:ConditionPlatable”, dpar = “mu2”),
prior(normal(0,5), class = “b”, coef = “RandomizationB:PhaseExtinction”, dpar = “mu2”),
prior(normal(0,5), class = “b”, coef = “RandomizationB:PhaseExtinction:ConditionPlatable”, dpar =“mu2”),
prior(normal(0,5), class = “b”, coef = “SessionPostMTx”, dpar =“mu2”),
prior(student_t(3, 0, 5), class = “sd”, dpar = “mu1”),
prior(student_t(3, 0, 5), class = “sd”, dpar = “mu2”)
)
and the model
Model1 ← brm_multiple(Valence ~ 1 + Randomization + Phase + Session + Randomization:Condition:Phase + (1 | ID),
data = Imp,
family=categorical(link = “logit”),
seed = 123
prior = priors
)
generates the error noted as above.
Registry key ‘SOFTWARE\R-core\Rtools’ not found
traceback suggests that it happens when the modeling when compiling
31.makeRestartList(…)
30.withRestarts({ .Internal(.signalCondition(simpleWarning(msg, call), msg, call)) .Internal(.dfltWarn(msg, call)) …
29…signalSimpleWarning(“running command ‘C:/PROGRA~1/R/R-36~1.1/bin/x64/R CMD SHLIB file2e844e4997a.cpp 2> file2e844e4997a.cpp.err.txt’ had status 314”, base::quote(system(cmd, intern = !verbose)))
28.system(cmd, intern = !verbose)
27.compileCode(f, code, language = language, verbose = verbose)
26.cxxfunction(sig = sig, body = body, plugin = plugin, includes = includes, settings = settings, …, verbose = verbose)
25.force(code)
24.withr::with_path(rtools_path(), code)
23.pkgbuild::with_build_tools(cxxfunction(sig = sig, body = body, plugin = plugin, includes = includes, settings = settings, …, verbose = verbose), required = rstan_options(“required”) && !identical(Sys.getenv(“WINDOWS”), “TRUE”) && !identical(Sys.getenv(“R_PACKAGE_SOURCE”), …
22.cxxfunctionplus(signature(), body = paste(" return Rcpp::wrap("", model_name, “");”, sep = “”), includes = inc, plugin = “rstan”, save_dso = save_dso | auto_write, module_name = paste(“stan_fit4”, model_cppname, “_mod”, sep = “”), verbose = verbose)
21…fun(model_code = .x1) at #1
20.eval(expr, envir, …)
19.eval(expr, envir, …)
18.eval2(call, envir = args, enclos = parent.frame())
17.do_call(rstan::stan_model, stan_model_args)
16.eval(expr, envir)
15.eval(expr, envir)
14.eval(expr, pf)
13.eval(expr, pf)
12.withVisible(eval(expr, pf))
11.evalVis(expr)
10.utils::capture.output(out ← eval(expr, envir), type = type, …)
9.eval_silent(do_call(rstan::stan_model, stan_model_args), silent = silence_stan_model, type = “message”)
8…fun(formula = .x1, data = .x2, family = .x3, prior = .x4, data2 = .x5, autocor = .x6, cov_ranef = .x7, sample_prior = .x8, sparse = .x9, knots = .x10, stanvars = .x11, stan_funs = .x12, seed = .x13, chains = .x14) at #1
7.eval(expr, envir, …)
6.eval(expr, envir, …)
5.eval2(call, envir = args, enclos = parent.frame())
4.do_call(brm, args)
3.withCallingHandlers(expr, message = function(c) invokeRestart(“muffleMessage”))
2.suppressMessages(do_call(brm, args))
1.brm_multiple(Choice1 ~ 1 + Randomization + Phase + Session + Randomization:Condition:Phase + (1 | ID), data = DisgustImpute, family = categorical(link = “logit”), seed = 123, )