Repository navigation
Classify the bioequivalence design from the study rows, not from every endpoint's rows together - #718
Open
billdenney wants to merge 15 commits into
Open
billdenney wants to merge 15 commits into
billdenney wants to merge 15 commits into
Conversation
be_fit_models() passed the rows of every endpoint to be_design(), so long data with several PPTESTCD values had several rows per subject and period: a 2x2 crossover with Cmax and AUC read as a full replicate (making the EMA and FDA frameworks look feasible), and a parallel study with two endpoints read as repeated measures, so lme4 refused the per-endpoint mixed model. The design is now classified from each endpoint's rows, and endpoints whose designs differ stop with pknca_error_be_design_endpoints_differ. be_design() and be_within_var(), which take one endpoint's rows, stop when a subject has more than one row in a period instead of reading the rows as replicates. The covariate-missing check of be_dataset() looks only at the rows of the requested endpoints, like its design-column check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… values Review of the per-endpoint classification: classifying each endpoint after the missing values were dropped let routine missingness (aucinf.obs without an estimable lambda.z) change one endpoint's design and stop a valid assessment. be_dataset() now keeps design_rows, the distinct subject, sequence, period, and treatment rows of the requested endpoints, including administrations whose value is missing, and be_fit_models() classifies the study from them. be_dataset() stops with pknca_error_be_dataset_duplicate_period when an endpoint has more than one value for a subject and period (results with several intervals), saying to filter to one interval, and with pknca_error_be_dataset_design_conflict when endpoints disagree on a subject's treatment or sequence in a period. be_compare() calls be_dataset() before its per-framework loop, so both are raised once there rather than as skipped frameworks. An endpoint left with one value per subject stops lmer and nlme with pknca_error_be_endpoint_not_repeated instead of an lme4 error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
be_fit_models()(and sobe_assess()andbe_compare()) passed the rows of every endpoint tobe_design(). Long NCA results hold one row per subject, period, and endpoint, so with severalPPTESTCDvalues each subject had several rows per period:"full_replicate", so reference scaling (EMA, FDA) looked feasible and failed later with a not-estimable error instead of the infeasible-design error;lmerfit failed with "number of levels of each grouping factor must be < number of observations".be_design()andbe_within_var()called directly on such data read the endpoint rows as replicated administrations in the same way.Fix
be_dataset()keepsdesign_rows: the distinct subject/sequence/period/treatment rows of the requested endpoints, including administrations whose value is missing, so missing values (such as an inestimable AUCinf) do not change the design.be_fit_models()classifies the study once from them. Adesigngiven by the user is still used as given.be_dataset()stops withpknca_error_be_dataset_duplicate_periodwhen an endpoint has more than one value for a subject and period (several intervals for one endpoint), and withpknca_error_be_dataset_design_conflictwhen endpoints disagree on a subject's treatment or sequence. Becausebe_compare()callsbe_dataset()first, these are raised once rather than swallowed per framework.pknca_error_be_endpoint_not_repeatednaming it, instead of the lme4 error.be_design()andbe_within_var()stop when a subject has more than one row in a period.be_dataset()checks covariates for missing values only in the rows of the requested endpoints.Tests
"2x2x2", the same result as one endpoint's data, and EMA givespknca_error_be_infeasible_design."parallel"/"anova", the same result as one endpoint's data.aucinf.obsmissing in 55 of 96 rows stays"full_replicate", and its result equals that endpoint assessed alone."2x2x2", and including Cmax gives the new error.be_assess()andbe_compare(), with exact messages; thebe_design()/be_within_var()guards.Stacked on
fix/no-tau-warning-group; this PR's diff is only this fix.🤖 Generated with Claude Code