These functions implement linear transformations, output distribution of which has desired center and spread. These functions are useful for creating distributions with some input center and spread value based on present distribution, which is a common task during hypothesis testing.
form_recenter(f, to, method = "mean") form_respread(f, to, method = "sd", center_method = "mean")
A desired value of summary.
Method of computing center for
A pdqr-function describing distribution with desired center or spread.
form_recenter(f, to, method) is basically a
f - summ_center(f, method) + to: it moves distribution without affecting
its shape so that output distribution has center at
form_respread(f, to, method, center_method) is a following linear
coef * (f - center) + center, where
summ_center(f, center_method) and
coef is computed so as to guarantee
output distribution to have spread equal to
to. In other words, this linear
transformation stretches distribution around its center until the result has
spread equal to
to (center remains the same as in input
my_beta <- as_d(dbeta, shape1 = 1, shape2 = 3) my_beta2 <- form_recenter(my_beta, to = 2) summ_center(my_beta2)#>  2my_beta3 <- form_respread(my_beta2, to = 10, method = "range") summ_spread(my_beta3, method = "range")#>  10# Center remains unchainged summ_center(my_beta3)#>  2