stats¶
stats.sample¶
Parameter samples: individual values or summary statistics, on the linear or the log scale.
A ParameterSample is the input of every function of pkpdutils.stats: the
values of one parameter over the individuals of a group, or the summary
statistics of a group as published (mean, sd, n, optionally geomean
and geocv). Pharmacokinetic parameters are log-normal, so the statistics
work on the log scale by default (Scale.LOG), where the summary statistics
are translated with the moment relations of the log-normal distribution
(Rowland & Tozer 2011, ch. 8; lognormal_from_moments).
Scale
¶
Bases: StrEnum
Scale of an analysis.
Summary
dataclass
¶
Summary(
n,
mean,
sd,
se,
cv,
geomean,
geocv,
median,
q25,
q75,
min,
max,
ci_low,
ci_high,
ci_level,
scale,
name,
unit,
)
Summary statistics of a parameter sample.
Attributes:
| Name | Type | Description |
|---|---|---|
n |
int
|
number of values (finite values, or |
mean |
float
|
arithmetic mean |
sd |
float
|
standard deviation ( |
se |
float
|
standard error of the mean, |
cv |
float
|
coefficient of variation, |
geomean |
float
|
geometric mean \(e^{\mu}\) |
geocv |
float
|
geometric coefficient of variation \(\sqrt{e^{\sigma^2} - 1}\) |
median |
float
|
median ( |
q25 |
float
|
first quartile ( |
q75 |
float
|
third quartile ( |
min |
float
|
minimum ( |
max |
float
|
maximum ( |
ci_low |
float
|
lower bound of the t interval of the mean ( |
ci_high |
float
|
upper bound of the interval |
ci_level |
float
|
level of the interval |
scale |
Scale
|
scale of the interval |
name |
str
|
name of the parameter |
unit |
str
|
unit of the parameter |
to_dict
¶
The fields as a dictionary.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Field name to value. |
ParameterSample
dataclass
¶
ParameterSample(
values=None,
labels=None,
coords=dict(),
mean=None,
sd=None,
n=None,
geomean=None,
geocv=None,
name="value",
unit="dimensionless",
)
The values of one parameter over a group of individuals, or the summary statistics of the group.
Individual data: values (1-D, NaN is skipped) with optional labels
(the identity of the individuals, used to pair two samples) and coords
(further attributes per individual, such as period and sequence of a
crossover study). Summary data: n with mean and sd and/or geomean
and geocv, as reported in a publication.
The two kinds do not mix: every statistic of individual data is computed
from its values, so a summary field given next to values would be kept
without ever being used, and labels and coords describe individuals,
which summary data does not have. Either combination raises ValueError.
Attributes:
| Name | Type | Description |
|---|---|---|
values |
ndarray | None
|
individual values, |
labels |
ndarray | None
|
label per value, |
coords |
dict[str, ndarray]
|
name to array with one entry per value, empty for summary data |
mean |
float | None
|
arithmetic mean of summary data, |
sd |
float | None
|
standard deviation of summary data, |
n |
int | None
|
number of individuals of summary data, |
geomean |
float | None
|
geometric mean of summary data, |
geocv |
float | None
|
geometric coefficient of variation of summary data, |
name |
str
|
name of the parameter |
unit |
str
|
unit of the parameter |
log_values
property
¶
The logarithms of the finite values.
Raises:
| Type | Description |
|---|---|
ValueError
|
if a finite value is not positive. |
log_moments
¶
Mean and standard deviation of the logarithm.
Individual data: the moments of log_values (ddof=1, NaN with a
single value). Summary data: lognormal_from_geometric when
geomean and geocv are given, else lognormal_from_moments.
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
|
linear_moments
¶
Arithmetic mean and standard deviation.
Summary data given only as geometric statistics are translated with
moments_from_lognormal.
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
|
moments
¶
Center, spread and size on a scale.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scale
|
Scale | str
|
|
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float, int]
|
The center, the standard deviation and the number of values. |
Raises:
| Type | Description |
|---|---|
ValueError
|
if |
select
¶
The individual data at a boolean mask, with its labels and coordinates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mask
|
ndarray
|
boolean array with one entry per value. |
required |
Returns:
| Type | Description |
|---|---|
ParameterSample
|
The selected sample. |
Raises:
| Type | Description |
|---|---|
ValueError
|
for summary data. |
coerce
¶
The member of an enumeration given as the member itself or as its string.
Every public function of pkpdutils.stats takes its options either way,
so compare(a, b, scale="log") is the analysis of
compare(a, b, scale=Scale.LOG) and an unknown string is rejected
instead of falling through to a default.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
E | str
|
the member or the string of the member. |
required |
enum_type
|
type[E]
|
the enumeration. |
required |
Returns:
| Type | Description |
|---|---|
E
|
The member. |
Raises:
| Type | Description |
|---|---|
ValueError
|
if |
lognormal_from_moments
¶
Log-scale moments of a log-normal distribution with the given mean and standard deviation.
\(\sigma^2 = \ln(1 + \mathrm{sd}^2 / \mathrm{mean}^2)\), \(\mu = \ln \mathrm{mean} - \sigma^2 / 2\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mean
|
float
|
arithmetic mean, positive. |
required |
sd
|
float
|
standard deviation, non-negative. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
if |
lognormal_from_geometric
¶
Log-scale moments from a geometric mean and a geometric coefficient of variation.
\(\mu = \ln \mathrm{geomean}\), \(\sigma = \sqrt{\ln(1 + \mathrm{geocv}^2)}\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
geomean
|
float
|
geometric mean, positive. |
required |
geocv
|
float
|
geometric coefficient of variation \(\sqrt{e^{\sigma^2} - 1}\), non-negative. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
if |
moments_from_lognormal
¶
Arithmetic mean and standard deviation of a log-normal distribution.
\(\mathrm{mean} = e^{\mu + \sigma^2/2}\), \(\mathrm{sd} = \mathrm{mean}\sqrt{e^{\sigma^2} - 1}\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mu
|
float
|
mean of the logarithm. |
required |
sigma
|
float
|
standard deviation of the logarithm. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
The arithmetic mean and standard deviation. |
log_positive
¶
The logarithms of an array which must be positive.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values
|
ndarray
|
the values. |
required |
name
|
str
|
name of the parameter for the error message. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
The logarithms. |
Raises:
| Type | Description |
|---|---|
ValueError
|
if a value is not positive. |
hedges_correction
¶
Small sample correction of the standardized mean difference.
\(J = 1 - 3 / (4N - 9)\) (Hedges 1981, the approximation of the exact gamma expression), with \(N\) the total number of values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_total
|
int
|
total number of values of both samples. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The factor |
pooled_sd
¶
Pooled standard deviation of two samples.
\(s_p = \sqrt{((n_a - 1) s_a^2 + (n_b - 1) s_b^2) / (n_a + n_b - 2)}\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sd_a
|
float
|
standard deviation of |
required |
n_a
|
int
|
size of |
required |
sd_b
|
float
|
standard deviation of |
required |
n_b
|
int
|
size of |
required |
Returns:
| Type | Description |
|---|---|
float
|
The pooled standard deviation, |
float
|
two values, so that its variance is not estimable. |
cohen_d
¶
Cohen's d and Hedges' g from the moments of two samples.
\(d = (\bar a - \bar b) / s_p\) with the pooled standard deviation,
\(g = J d\) with the small sample correction of hedges_correction
(Hedges 1981).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mean_a
|
float
|
mean of |
required |
sd_a
|
float
|
standard deviation of |
required |
n_a
|
int
|
size of |
required |
mean_b
|
float
|
mean of |
required |
sd_b
|
float
|
standard deviation of |
required |
n_b
|
int
|
size of |
required |
Returns:
| Type | Description |
|---|---|
float
|
|
float
|
the pooled standard deviation is not estimable, or if it is zero. |
welch_se
¶
Standard error of the difference of two means with unequal variances.
\(\mathrm{se} = \sqrt{s_a^2/n_a + s_b^2/n_b}\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
var_a
|
float
|
variance of |
required |
n_a
|
int
|
size of |
required |
var_b
|
float
|
variance of |
required |
n_b
|
int
|
size of |
required |
Returns:
| Type | Description |
|---|---|
float
|
The standard error, |
welch_df
¶
Welch-Satterthwaite degrees of freedom.
\(\nu = (s_a^2/n_a + s_b^2/n_b)^2 / ((s_a^2/n_a)^2/(n_a-1) + (s_b^2/n_b)^2/(n_b-1))\).
A sample of a single value has no variance to propagate and two samples
without variance have no scale, both give NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
var_a
|
float
|
variance of |
required |
n_a
|
int
|
size of |
required |
var_b
|
float
|
variance of |
required |
n_b
|
int
|
size of |
required |
Returns:
| Type | Description |
|---|---|
float
|
The degrees of freedom, |
float
|
values or both variances are zero. |
exp_t_interval
¶
The exponentiated two-sided t interval of an estimate on the log scale.
\(\exp(\hat\theta \pm t_{1-\alpha/2, df}\,\mathrm{se})\), the interval of a geometric mean or of a geometric mean ratio (FDA 2001).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
center
|
float
|
the estimate on the log scale. |
required |
se
|
float
|
its standard error. |
required |
df
|
float
|
degrees of freedom. |
required |
ci_level
|
float
|
level of the interval. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The lower and the upper bound of the interval of the ratio, both |
float
|
|
labels_match
¶
Whether both samples are individual, labelled and share an individual.
Which values are finite does not enter, so a missing value does not turn a paired design into an unpaired one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
ParameterSample
|
the first sample. |
required |
b
|
ParameterSample
|
the second sample. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
|
paired_indices
¶
The indices of the matched pairs of two samples of individual data.
When both samples carry labels the pairs are matched by label: a label which only one sample carries is dropped, so a missing individual does not break the pairing. Without labels on both samples (also when only one of them is labelled) the pairs are matched by position and the samples must have the same length. A pair is dropped when either of its two values is not finite; dropped pairs are logged at debug level.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
ParameterSample
|
the first sample. |
required |
b
|
ParameterSample
|
the second sample. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
The indices into |
ndarray
|
pairs, in the order of |
Raises:
| Type | Description |
|---|---|
ValueError
|
for summary data, for labels which are duplicated within a sample or whose sets are disjoint, for unequal sizes without labels, or when no pair of finite values remains. |
paired_values
¶
The raw values of two samples as matched pairs, see paired_indices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
ParameterSample
|
the first sample. |
required |
b
|
ParameterSample
|
the second sample. |
required |
Returns:
| Type | Description |
|---|---|
tuple[ndarray, ndarray]
|
The values of |
Raises:
| Type | Description |
|---|---|
ValueError
|
as |
summarize
¶
Summary statistics of a parameter sample.
The arithmetic statistics, the geometric mean and the geometric CV, the
quantiles of individual data, and a t interval: of the mean on the
LINEAR scale, \(\bar x \pm t_{1-\alpha/2, n-1}\,\mathrm{sd}/\sqrt{n}\), and of the
geometric mean on the LOG scale, \(\exp(\mu \pm t_{1-\alpha/2, n-1}\,\sigma/\sqrt{n})\).
The interval and the spread are NaN with a single value. On LOG a
non-positive value raises ValueError; on LINEAR it is tolerated and
geomean/geocv come back as NaN instead.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values
|
ParameterSample | ArrayLike
|
a sample, or individual values ( |
required |
scale
|
Scale | str
|
scale of the interval, as the member or as its string. |
LOG
|
ci_level
|
float
|
level of the interval. |
0.95
|
name
|
str
|
name of the parameter (ignored for a sample, which carries its own). |
'value'
|
unit
|
str
|
unit of the parameter (ignored for a sample). |
'dimensionless'
|
Returns:
| Type | Description |
|---|---|
Summary
|
The summary. |
Raises:
| Type | Description |
|---|---|
ValueError
|
if |
stats.tests¶
Significance tests on parameter samples and the adjustment of p values.
compare runs the t tests (Student, Welch, paired), the rank tests
(Mann-Whitney U, Wilcoxon signed rank) and a permutation test of scipy on
two samples, on the log scale by default, and reports the effect with its
t interval and the standardized effect sizes (Cohen's d, Hedges' g; Hedges
1981). Summary data (mean, sd, n) is compared with the Welch t test
from the moments (scipy.stats.ttest_ind_from_stats), on the log scale with
the log-normal moments of ParameterSample.log_moments.
hodges_lehmann is the distribution free companion of the rank tests: the
median of the Walsh averages (paired) or of the pairwise differences
(unpaired) with a confidence interval built from the order statistics of the
same null distribution (Hodges & Lehmann 1963). It is the comparison the EMA
asks for when \(t_\mathrm{max}\) matters, which is neither log-normal nor an
acceptance parameter.
TestMethod
¶
Bases: StrEnum
Test of compare.
Alternative
¶
Bases: StrEnum
Alternative hypothesis, as in scipy.
AdjustMethod
¶
Bases: StrEnum
Adjustment of p values for multiple comparisons.
TestResult
dataclass
¶
TestResult(
test,
statistic,
p_value,
effect,
ci_low,
ci_high,
ci_level,
scale,
alternative,
paired,
df,
cohen_d,
hedges_g,
n_a,
n_b,
name,
unit,
)
Result of compare.
Attributes:
| Name | Type | Description |
|---|---|---|
test |
TestMethod
|
the test which was run ( |
statistic |
float
|
the test statistic |
p_value |
float
|
the p value under |
effect |
float
|
difference of the means |
ci_low |
float
|
lower bound of the interval of the effect (t tests; one-sided under a one-sided alternative), |
ci_high |
float
|
upper bound of the interval |
ci_level |
float
|
level of the interval |
scale |
Scale
|
scale of the analysis |
alternative |
Alternative
|
the alternative hypothesis |
paired |
bool
|
whether the samples were paired |
df |
float
|
degrees of freedom of a t test, |
cohen_d |
float
|
standardized difference of the means on the analysis scale, pooled standard deviation |
hedges_g |
float
|
|
n_a |
int
|
number of values of |
n_b |
int
|
number of values of |
name |
str
|
name of the parameter (of |
unit |
str
|
unit of the parameter |
to_dict
¶
The fields as a dictionary with the enumerations as strings.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Field name to value. |
compare
¶
compare(
a,
b,
*,
test=AUTO,
scale=LOG,
paired=False,
alternative=TWO_SIDED,
ci_level=0.95,
n_perm=9999,
seed=None,
)
Compare two samples of a parameter.
AUTO runs the paired t test for paired=True and the Welch t test
otherwise; summary data is compared with the Welch t test from its
moments. On the log scale the tests run on the logarithms and the effect
is the ratio of the geometric means with the exponentiated t interval.
The paired tests need individual data of both samples and match it with
paired_values, by label when both samples carry labels and by position
otherwise; a pair with a missing value is dropped, and so is an
individual only one of the samples holds. Every field of the result is
computed from the values the test runs on, the finite values of each
sample or the remaining pairs: the effect (the medians of the rank tests
included), its interval, Cohen's d, Hedges' g and the counts describe
the same individuals as the p value. The permutation test
permutes the group labels (or the signs of the paired differences) of
the difference of the means, with n_perm resamples (Efron & Tibshirani
1993, ch. 15). A sample of one value or two samples without variance
give NaN for statistic, p_value, df, the interval and the effect
sizes; a sample without a finite value gives a NaN effect as well,
unpaired, and raises on the paired path, where no pair remains.
test, scale and alternative are taken as the enumeration member or
as its string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
ParameterSample
|
the first sample. |
required |
b
|
ParameterSample
|
the second sample. |
required |
test
|
TestMethod | str
|
the test. |
AUTO
|
scale
|
Scale | str
|
scale of the analysis. |
LOG
|
paired
|
bool
|
whether the values of |
False
|
alternative
|
Alternative | str
|
the alternative hypothesis. |
TWO_SIDED
|
ci_level
|
float
|
level of the interval of the effect. |
0.95
|
n_perm
|
int
|
number of resamples of the permutation test. |
9999
|
seed
|
int | None
|
seed of the permutation test. |
None
|
Returns:
| Type | Description |
|---|---|
TestResult
|
The result. |
Raises:
| Type | Description |
|---|---|
ValueError
|
for an unknown |
hodges_lehmann
¶
The Hodges-Lehmann estimate of the median difference with a distribution free interval.
The estimator of Hodges & Lehmann (1963) is the median of the Walsh averages of the paired differences,
for paired data and the median of the \(n_a n_b\) pairwise differences
\(a_i - b_j\) for two independent samples. Its confidence interval is a
pair of order statistics of the same quantities: with \(w\) the smallest
value of the null statistic whose cumulative probability reaches
\(\alpha/2\), the interval runs from the \(w\)-th smallest to the
\(w\)-th largest, which is the interval R reports for wilcox.test. The
null distribution is enumerated exactly up to EXACT_MAX_N values per
sample (the subsets of the signed ranks, the partitions of the Mann-Whitney
statistic) and approximated by the normal distribution of its mean and
variance above, where the exact enumeration no longer changes the answer.
The p value is the matching two-sided rank test of scipy, the Wilcoxon
signed rank test for paired and the Mann-Whitney U test for independent
samples.
The analysis runs on the values as they are, not on their logarithms: it
is the comparison of \(t_\mathrm{max}\) the EMA asks for when a rapid
onset is claimed to be clinically relevant ("no apparent difference in
median \(t_\mathrm{max}\) and its variability"), a parameter which is read
from the sampling grid, is not log-normal and is no acceptance parameter
of bioequivalence. Exposure parameters are analysed with tost instead,
which both the EMA and the FDA require for \(\mathrm{AUC}\) and
\(C_\mathrm{max}\).
Ties are kept as they are: the estimate and the interval are well defined, while the exact null distribution assumes no ties, so the p value of a sample with ties is scipy's tie-corrected one and the interval is conservative.
The null distribution is discrete, so an interval of order statistics
rarely has exactly the requested coverage: the ci_level of the result is
the level the interval achieves, \(1 - 2 P(W \le w - 1)\), which is
what R reports as the conf.level of wilcox.test. A sample too small for
the requested level gets the two extreme order statistics, and ci_level
then says how little they cover (four pairs at a requested 0.90 achieve
0.875); above EXACT_MAX_N, where the exact distribution is not
enumerated, the requested level is reported as it is.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
ParameterSample
|
the first sample, individual values. |
required |
b
|
ParameterSample
|
the second sample, individual values. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
paired |
bool | None
|
whether the values belong to the same individuals; detected
from the labels of the samples by default ( |
ci_level |
float
|
the level asked for, 0.90 as for the bioequivalence
interval; the level the interval achieves is reported back in
|
Returns:
| Type | Description |
|---|---|
TestResult
|
The result, with the estimate in |
TestResult
|
and |
TestResult
|
in |
TestResult
|
|
TestResult
|
values, has an estimate but no interval ( |
Raises:
| Type | Description |
|---|---|
ValueError
|
for summary data, for a |
multiple_comparison
¶
Adjust p values for multiple comparisons.
Bonferroni: \(\min(1, m p_i)\). Holm (step-down): sort ascending, \(\tilde p_{(i)} = \max_{j \le i} \min(1, (m - j + 1) p_{(j)})\). Benjamini-Hochberg (step-up): \(\tilde p_{(i)} = \min_{j \ge i} \min(1, m p_{(j)} / j)\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p_values
|
ArrayLike
|
the p values. |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
method |
AdjustMethod | str
|
the adjustment, as the member or as its string. |
Returns:
| Type | Description |
|---|---|
ndarray
|
The adjusted p values in the order of the input. |
Raises:
| Type | Description |
|---|---|
ValueError
|
if |
stats.ratio¶
Geometric mean ratio of a parameter between a test and a reference sample, and its publication table.
RatioResult
dataclass
¶
RatioResult(
gmr,
ci_low,
ci_high,
ci_level,
log_ratio,
se_log,
df,
paired,
n_test,
n_reference,
name,
unit,
)
Geometric mean ratio with its t interval on the log scale.
Attributes:
| Name | Type | Description |
|---|---|---|
gmr |
float
|
geometric mean ratio test / reference |
ci_low |
float
|
lower bound of the interval of the ratio |
ci_high |
float
|
upper bound of the interval |
ci_level |
float
|
level of the interval |
log_ratio |
float
|
\(\ln \mathrm{GMR}\) |
se_log |
float
|
standard error of |
df |
float
|
degrees of freedom of the t interval |
paired |
bool
|
whether the samples were paired |
n_test |
int
|
number of values of the test sample |
n_reference |
int
|
number of values of the reference sample |
name |
str
|
name of the parameter |
unit |
str
|
unit of the parameter |
to_dict
¶
The fields as a dictionary.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Field name to value. |
ratio
¶
Geometric mean ratio of a parameter, test over reference, with a t interval.
Paired (crossover design): \(d_i = \ln t_i - \ln r_i\), \(\ln \mathrm{GMR} = \bar d\),
\(\mathrm{se} = s_d / \sqrt{n}\), \(n - 1\) degrees of freedom. Unpaired (parallel
groups): the Welch t interval of \(\bar{\ln t} - \bar{\ln r}\). The interval of
the ratio is the exponentiated interval (FDA 2001; Schuirmann 1987).
Summary data uses the log moments of ParameterSample.log_moments.
Paired samples are matched with paired_values, by label when both
samples carry labels and by position otherwise; a pair with a missing
value is dropped. A sample of one value or two samples without variance
give NaN for se_log, df and the interval, the gmr stays finite;
an unpaired sample without a finite value gives NaN throughout, a
paired one raises, as no pair remains.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
test
|
ParameterSample
|
the test sample. |
required |
reference
|
ParameterSample
|
the reference sample. |
required |
ci_level
|
float
|
level of the interval, 0.90 by default as in bioequivalence. |
0.9
|
paired
|
bool | None
|
pair the samples (by label when both have labels, else by
position); |
None
|
Returns:
| Type | Description |
|---|---|
RatioResult
|
The ratio. |
Raises:
| Type | Description |
|---|---|
ValueError
|
for a paired ratio on summary data, unequal sizes, labels which do not match, or no pair of finite values. |
ratio_table
¶
The ratio table of a publication: one row per parameter, formatted.
The table a bioequivalence, food effect or special population study
reports: the geometric mean ratio of every parameter with its confidence
interval, as percentages of the reference (percent, the convention of
the regulatory guidances: 93.1 % rather than 0.931) or as plain ratios.
A pkpdutils.stats.BEResult adds the within-subject coefficient of
variation and the verdict of the acceptance limits.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ratios
|
Mapping[str, RatioResult] | BEResult
|
parameter name to its |
required |
digits
|
int
|
significant digits of the numbers. |
3
|
percent
|
bool
|
report the ratio and its interval in percent. |
True
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
The table with the columns |
DataFrame
|
|
DataFrame
|
bioequivalence result, |
DataFrame
|
cell is a string. |