Hello,
I’m running simulations over several scenarios, and I’m getting errors when running pumas_be
on one specific scenario. I’m unable to identify the cause of the errors.
I’m running the following lines of code on the data I’ve pasted at the bottom:
cmax_output = pumas_be(test, endpoint = :cmax)
auc_output = pumas_be(test, endpoint = :auc)
auc0_28_output = pumas_be(test, endpoint = :auc0_28)
auc7_28_output = pumas_be(test, endpoint = :auc7_28)
auc_output and auc7_28_output run, but I get the following errors for cmax_output and auc0_28 output:
julia> cmax_output = pumas_be(test5, endpoint = :cmax)
ERROR: ArgumentError: reducing over an empty collection is not allowed
Stacktrace:
[1] _empty_reduce_error()
@ Base ./reduce.jl:301
[2] mapreduce_empty(f::Function, op::Base.BottomRF{typeof(Base.add_sum)}, T::Type)
@ Base ./reduce.jl:344
[3] reduce_empty(op::Base.MappingRF{Bioequivalence.var"#6#11", Base.BottomRF{typeof(Base.add_sum)}}, #unused#::Type{Float64})
@ Base ./reduce.jl:331
[4] reduce_empty(op::Base.FilteringRF{Bioequivalence.var"#7#12", Base.MappingRF{Bioequivalence.var"#6#11", Base.BottomRF{typeof(Base.add_sum)}}}, #unused#::Type{Float64})
@ Base ./reduce.jl:332
[5] reduce_empty_iter
@ ./reduce.jl:357 [inlined]
[6] reduce_empty_iter
@ ./reduce.jl:356 [inlined]
[7] foldl_impl
@ ./reduce.jl:49 [inlined]
[8] mapfoldl_impl
@ ./reduce.jl:44 [inlined]
[9] #mapfoldl#244
@ ./reduce.jl:162 [inlined]
[10] mapfoldl
@ ./reduce.jl:162 [inlined]
[11] #mapreduce#248
@ ./reduce.jl:289 [inlined]
[12] mapreduce
@ ./reduce.jl:289 [inlined]
[13] #sum#251
@ ./reduce.jl:503 [inlined]
[14] sum
@ ./reduce.jl:503 [inlined]
[15] #sum#252
@ ./reduce.jl:532 [inlined]
[16] sum(a::Base.Generator{Base.Iterators.Filter{Bioequivalence.var"#7#12", Vector{Float64}}, Bioequivalence.var"#6#11"})
@ Base ./reduce.jl:532
[17] satterthwaite(model::MixedModels.LinearMixedModel{Float64}, L::Matrix{Float64})
@ Bioequivalence /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Bioequivalence/AEgIQ/src/satterthwaite.jl:95
[18] walds_tests(model::MixedModels.LinearMixedModel{Float64})
@ Bioequivalence /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Bioequivalence/AEgIQ/src/Bioequivalence.jl:299
[19] pumas_be(data::DataFrame; endpoint::Symbol, logtransformed::Bool, reference_scale::Float64, cv_max::Float64, id::String, sequence::String, period::String, nonparametric::Bool, reml::Bool)
@ Bioequivalence /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Bioequivalence/AEgIQ/src/Bioequivalence.jl:1025
[20] top-level scope
@ ~/data/code/padagis_mibe/modeling/partial replicate design simulations (parallel absorption - zo, Erlang) 3.jl:676
julia> auc0_28_output = pumas_be(test5, endpoint = :auc0_28)
ERROR: DomainError with -13.175565702861608:
FDist: the condition ν2 > zero(ν2) is not satisfied.
Stacktrace:
[1] #269
@ /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Distributions/7iOJp/src/univariate/continuous/fdist.jl:30 [inlined]
[2] check_args
@ /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Distributions/7iOJp/src/utils.jl:89 [inlined]
[3] _
@ /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Distributions/7iOJp/src/univariate/continuous/fdist.jl:30 [inlined]
[4] #FDist#272
@ /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Distributions/7iOJp/src/univariate/continuous/fdist.jl:35 [inlined]
[5] #FDist#274
@ /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Distributions/7iOJp/src/univariate/continuous/fdist.jl:37 [inlined]
[6] FDist(ν1::Int64, ν2::Float64)
@ Distributions /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Distributions/7iOJp/src/univariate/continuous/fdist.jl:37
[7] satterthwaite(model::MixedModels.LinearMixedModel{Float64}, L::Matrix{Float64})
@ Bioequivalence /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Bioequivalence/AEgIQ/src/satterthwaite.jl:98
[8] walds_tests(model::MixedModels.LinearMixedModel{Float64})
@ Bioequivalence /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Bioequivalence/AEgIQ/src/Bioequivalence.jl:299
[9] pumas_be(data::DataFrame; endpoint::Symbol, logtransformed::Bool, reference_scale::Float64, cv_max::Float64, id::String, sequence::String, period::String, nonparametric::Bool, reml::Bool)
@ Bioequivalence /build/_work/PumasSystemImages/PumasSystemImages/julia_depot/packages/Bioequivalence/AEgIQ/src/Bioequivalence.jl:1025
[10] top-level scope
@ ~/data/code/padagis_mibe/modeling/partial replicate design simulations (parallel absorption - zo, Erlang) 3.jl:678
There are only 4 subjects with an RTT/TRR replicate design, but a scenario with 40% WSV ran without problems. This scenario has no WSV. Could I get some help identifying why I’m getting these errors?
The data causing the errors is below:
id rep period cmax auc auc0_28 auc7_28 Nsubj input_tr_ratio BOV sequence formulation p_extrap_auc0_28
1 1 1 26.95198647 11.05709908 10.19941708 2.135242623 4 1 0.1 RTT R 7.756844729
1 1 2 38.42458639 12.4261716 11.40120656 2.407952729 4 1 0.1 RTT T 8.248437836
1 1 3 33.437928 12.62193615 11.69189361 2.548529996 4 1 0.1 RTT T 7.368461747
2 1 1 25.95525597 12.24250729 11.41183829 3.997105946 4 1 0.1 RTT R 6.785121543
2 1 2 27.55211256 13.32263612 11.51540158 4.025919439 4 1 0.1 RTT T 13.56514227
2 1 3 22.27539908 16.13506787 13.79141672 5.1853434 4 1 0.1 RTT T 14.52520168
3 1 1 19.61582162 6.753974148 6.527068701 2.333494383 4 1 0.1 TRR T 3.359584169
3 1 2 21.31397657 7.995812583 7.951315931 2.655606377 4 1 0.1 TRR R 0.556499435
3 1 3 20.20298612 9.744124406 9.640481691 4.010845008 4 1 0.1 TRR R 1.06364318
4 1 1 27.4860378 14.62849581 13.5428536 5.179847392 4 1 0.1 TRR T 7.42142066
4 1 2 31.37180564 15.16105866 12.51296622 4.044817363 4 1 0.1 TRR R 17.46640854
4 1 3 24.53625692 15.47109261 13.63232752 4.709957563 4 1 0.1 TRR R 11.88516637