billdenney / pknca

An R package is designed to perform all noncompartmental analysis (NCA) calculations for pharmacokinetic (PK) data.
http://billdenney.github.io/pknca/
GNU Affero General Public License v3.0
69 stars 23 forks source link

Clarification of Values within Result Summary #85

Closed JSC67 closed 6 years ago

JSC67 commented 6 years ago

Hi Dr. Denney,

I've just listened to your YouTube PKNCA tutorial (https://www.youtube.com/watch?v=WCmFrheYtcc), and at 20:31 at the bottom you have some summary() results. Some of the quantities are in brackets, e.g. auclast is 74.6 [24.3], and tmax is 1.14 [0.630, 3.55]. I'm sorry to ask what's probably an obvious question (at least if you know the answer), but can you please elaborate on how to read this? What do the quantities inside and outside the square brackets mean, and why for some are the bracketed quantities a vector?

Also, is there a function for making pretty tabular output (e.g., HTML) similar to what WinNonlin can do?

Thanks for PKNCA!

-James

billdenney commented 6 years ago

Thanks for asking here!

The summarization is described in https://cran.r-project.org/web/packages/PKNCA/vignettes/Introduction-and-Usage.html#summarization-options-the-pknca.set.summary-function and using the PKNCA.set.summary() function.

The default for most parameters is that the value before the [] is the geometric mean and the value within the brackets is the geometric %CV. Discrete values (like tmax) are summarized with median and range in brackets.

For making pretty tabular output, PKNCA doesn't do it directly, but there are loads of other packages that will convert a data.frame into html. A good comparison of packages that will help convert data.frames into a variety of output formats is at https://hughjonesd.github.io/huxtable/design-principles.html (this isn't an endorsement of huxtable specifically, but the comparison table is the best I know of). I use pander for most of my table generation and most of my reporting occurs via knitr/rmarkdown.

billdenney commented 6 years ago

FYI, I'm keeping this issue open as a note to improve the documentation around the summary results.

billdenney commented 6 years ago

Hi @JSC67,

I updated the summary of PKNCAresults so that:

slyrus commented 6 years ago

Should the caption print a newline at the end? Now when I print my PKNCAresults from ESS I get the following:

Caption:  auclast, aumclast, aumcall, cmax, ptr, aucinf.obs, aucinf.pred, vss.obs, vss.pred: geometric mean and geometric coefficient of variation; tmax: median and range; half.life, aucpext.obs, aucpext.pred: arithmetic mean and standard deviation> 

with the ">" being the prompt for the next line of input.

billdenney commented 6 years ago

Good catch! RStudio appears to add a newline even though I didn't put it in the code.

I'm working to add it, but I don't see the right way to make a test for the carriage return at the end (https://stackoverflow.com/questions/52932220/is-it-possible-to-use-testthatexpect-output-to-expect-a-carriage-return). When I can make the test, it'll be fixed.