nicebread / BFDA

An R package for Bayes Factor Design Analysis
28 stars 9 forks source link

problem when entering n.max #21

Open dt492 opened 8 months ago

dt492 commented 8 months ago

Hello,

Thank you for developing this useful package. I have used it successfully in the past, but now get an error message when I specify any n.max:

BFDA.analyze(Sim1, design="sequential", n.min=10, n.max=50, boundary=10)

Warning messages: 1: In BFDA.analyze.sequential(BFDA = list(settings = list(n.min = 24, : Error: The selected n.max (50) for analysis is larger than the largest n (49) in the simulation stage. Cannot produce a meaningful analysis. 2: In BFDA.analyze.sequential(BFDA = list(settings = list(n.min = 24, : outcomes do not sum up to 100%!

But no error message when I leave it out:

BFDA.analyze(Sim1, design="sequential", n.min=10, boundary=10)

Although the error message (above) suggests that I have used an n.max larger that the one in the simulation, the n.max of my simulation was actually 300.

Additionally, when I decreased the n.max to 20, to see if that would solve the problem, I get another error:

Error in if (var(sim$n) == 0) { : missing value where TRUE/FALSE needed In addition: Warning messages: 1: In max(sim$n) : no non-missing arguments to max; returning -Inf 2: In max(sim$n) : no non-missing arguments to max; returning -Inf 3: In BFDA.analyze.sequential(BFDA = list(settings = list(n.min = 24, : Error: The selected n.max (20) for analysis is larger than the largest n (-Inf) in the simulation stage. Cannot produce a meaningful analysis. 4: There were 2 warnings in filter(). The first warning was: ℹ In argument: max(logBF) <= logBoundary[2] & min(logBF) >= logBoundary[1]. Caused by warning in max(): ! no non-missing arguments to max; returning -Inf ℹ Run dplyr::last_dplyr_warnings() to see the 1 remaining warning.

I suspect the issue has to do with other libraries that I might need to update or with my version of R. To check this I reinstalled R studio and use verison 2023.12.1 Build 402; I also reinstalled BFDA.

Many thanks for your advice, Deborah