You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running sparse NCA, pk.nca() aborts if the concentration data contains any NA. A single NA anywhere is fatal; it's not about the pooled mean being undefined.
What I'd suggest: handle NAs when forming the sparse mean rather than asserting them away. Options, roughly in order of preference:
In as_sparse_pk(), allow missing concentrations (any_missing_conc = TRUE) and drop NA records when building the per-timepoint groups, so each mean is computed over the available subjects.
In sparse_mean(), the per-timepoint mean currently uses mean(current_time$conc) with no na.rm — using na.rm = TRUE (and adjusting the sparse n/df for that timepoint accordingly) would make it robust.
If a timepoint has all subjects missing, drop that timepoint from the mean profile rather than erroring.
At minimum, if you'd rather keep the strict assertion, a clearer error message (which subject/timepoint, and guidance to remove NAs for sparse) would help a lot.
For now in aNCA we're working around it by dropping NA-concentration rows before the sparse calculation (unless the user imputed NAs), but it'd be great to have this handled upstream by PKNCA. I will open a small PR proposal for this
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
When running sparse NCA, pk.nca() aborts if the concentration data contains any NA. A single NA anywhere is fatal; it's not about the pooled mean being undefined.
What I'd suggest: handle NAs when forming the sparse mean rather than asserting them away. Options, roughly in order of preference:
For now in aNCA we're working around it by dropping NA-concentration rows before the sparse calculation (unless the user imputed NAs), but it'd be great to have this handled upstream by PKNCA. I will open a small PR proposal for this
Beta Was this translation helpful? Give feedback.
All reactions