This code crashes at some point when T is above 200 (and when T = 300, doesn't seem to run at all):
SSDANOVA(hyp1="mu1=mu2=mu3", # H0
hyp2 = "mu3>mu2>mu1", # H1
type= 'equal',
f1 = c(0,0,0),
f2=c(59.7,62.7,65.7),
var = c(6^2,6^2,6^2),
BFthresh = 3,
eta = 0.8,
T = 200,
seed = 10)
traceback()
8: stop(simpleError(msg, call = expr))
7: e$fun(obj, substitute(ex), parent.frame(), e$data)
6: (function (obj, ex)
{
e <- getDoPar()
e$fun(obj, substitute(ex), parent.frame(), e$data)
})(structure(list(args = (1:T)(.doRNG.stream = list(c(10407L,
636094904L, 1218453593L, 1782017094L, 1260864015L, 1859758340L,
2061863989L), c(10407L, -149956858L, -1342296740L, -977115029L,
1023403086L, -190978272L, -259017114L), c(10407L, -485421075L,
1390978645L, -1319636584L, -1052524345L, -1844081638L, 214077476L
), c(10407L, 1783509965L, -1888243428L, -1548404885L, -1452847580L,
-1614725690L, -713037210L), c(10407L, -1693492711L, 1839378532L,
-1350739592L, 738045061L, 756670425L, 2093061979L), c(10407L,
518235033L, 38796219L, -586960374L, 339843962L, 2043009591L,
925691322L), c(10407L, 1253899904L, -1960811876L, 1914288393L,
2060118580L, 1099291283L, -206179298L), c(10407L, -373769194L,
1066706016L, -2072836583L, 661937307L, -991318806L, 1309593129L
), c(10407L, 1060109385L, -823291193L, 1696634367L, 175818162L,
470220536L, 107956782L), c(10407L, 930102777L, -25880024L, 1289359440L,
1438611799L, -732326323L, 1197724552L), c(10407L, -697378553L,
1014213538L, -643914820L, -1655933141L, -901427596L, -1755975558L
...
5: do.call(`%dopar%`, list(obj, ex), envir = parent.frame())
4: foreach(i = 1:T) %dorng% {
library(bain)
if (type == "equal") {
library(bain)
datalist_temp <- unlist(lapply(1:length(m), function(x) rnorm(N,
m[x], mean(sd))))
L_temp <- unlist(lapply(1:length(m), function(x) rep(x,
length = N)))
datalist <- matrix(datalist_temp, nrow = length(m) *
N, ncol = 1)
L <- matrix(L_temp, nrow = length(m) * N, ncol = 1)
dd <- data.frame(datalist, L)
mu <- factor(dd$L)
y <- lm(dd$datalist ~ mu - 1)
estimate <- coef(y)
n <- table(dd$L)
var1 <- summary(y)$sigma^2
Sigma <- lapply(1:length(m), function(x) matrix(var1/n[x],
nrow = 1, ncol = 1))
}
...
3: cal_bf_anova(N, mu1, sd, T, J, varnames, hyp2, flag_output = 0,
flag_fast, type, hyp2, seed)
2: cal_medbf_anova(N_min, mu1, mu2, sd, T, J, varnames, hyp1, hyp2,
ERr2, IRr2, BFthresh, eta, flag_fast, type, seed)
1: SSDANOVA(hyp1 = "mu1=mu2=mu3", hyp2 = "mu3>mu2>mu1", type = "equal",
f1 = c(0, 0, 0), f2 = c(59.7, 62.7, 65.7), var = c(6^2, 6^2,
6^2), BFthresh = 3, eta = 0.8, T = 265, seed = 10)
This code crashes at some point when T is above 200 (and when T = 300, doesn't seem to run at all):
The error produced is:
Error in { : task 236 failed - "missing value where TRUE/FALSE needed"The traceback is:
SessionInfo():
Note that it will run when
hyp2 = "Ha"