nextBest-NextBestMaxGain Method.Helper function that for a given target doses finds the dose in grid that is
closest and below the target. There are four different targets in the context
of nextBest-NextBestMaxGain() method: \(min(`dose_mg`, `dose_target_drt`)\),
dose_mg, dose_target_drt or dose_target_eot.
h_next_best_mg_doses_at_grid(
dose_target_drt,
dose_target_eot,
dose_mg,
dose_grid,
doselimit,
placebo
)(number)
target dose estimate during the trial.
(number)
target dose estimate at the end of the trial.
(number)
the dose corresponding to the maximum gain.
(numeric)
all possible doses.
(number)
the maximum allowed next dose.
(flag)
if TRUE the first dose level in the dose_grid
is considered as placebo.