Title: | Helper Functions for Bayesian Analyses |
---|---|
Description: | Functions to 'numericise' 'R' objects (coerce to numeric objects), summarise 'MCMC' (Monte Carlo Markov Chain) samples and calculate deviance residuals as well as 'R' translations of some 'BUGS' (Bayesian Using Gibbs Sampling), 'JAGS' (Just Another Gibbs Sampler), 'STAN' and 'TMB' (Template Model Builder) functions. |
Authors: | Nicole Hill [aut, cre] , Joe Thorley [aut] , Kirill Müller [ctb] , Nadine Hussein [ctb] , Poisson Consulting [cph, fnd] |
Maintainer: | Nicole Hill <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.7.3.9002 |
Built: | 2024-11-30 07:51:25 UTC |
Source: | https://github.com/poissonconsulting/extras |
Coerces an object to an list. All attributes are removed except any names.
as_list(x, ...) ## Default S3 method: as_list(x, ...)
as_list(x, ...) ## Default S3 method: as_list(x, ...)
x |
An object. |
... |
Other arguments passed to methods. |
A list.
as_list(1:3) as_list(c(x = 1, y = 2))
as_list(1:3) as_list(c(x = 1, y = 2))
Coerces an object to an list. All attributes are removed except any names.
as_list_unnamed(x, ...) ## Default S3 method: as_list_unnamed(x, ...)
as_list_unnamed(x, ...) ## Default S3 method: as_list_unnamed(x, ...)
x |
An object. |
... |
Other arguments passed to methods. |
A list.
as_list_unnamed(1:3) as_list_unnamed(c(x = 1, y = 2))
as_list_unnamed(1:3) as_list_unnamed(c(x = 1, y = 2))
Checks if an object is a vector of one or more positive integer values.
chk_index(x, x_name = NULL) vld_index(x)
chk_index(x, x_name = NULL) vld_index(x)
x |
An object. |
x_name |
A string of the name of object x or NULL. |
The chk_
function throws an informative error if the test fails.
The vld_
function returns a flag indicating whether the test was met.
vld_index()
: Validate Index
x <- c(2L, 1L) chk_index(x) y <- c(2L, -1L) try(chk_index(y)) vld_index(c(-1)) vld_index(c(3L, 1L))
x <- c(2L, 1L) chk_index(x) y <- c(2L, -1L) try(chk_index(y)) vld_index(c(-1)) vld_index(c(3L, 1L))
Checks if an object is a list of indices ie vectors of one or more positive integer values.
chk_indices(x, x_name = NULL) vld_indices(x)
chk_indices(x, x_name = NULL) vld_indices(x)
x |
An object. |
x_name |
A string of the name of object x or NULL. |
The chk_
function throws an informative error if the test fails.
The vld_
function returns a flag indicating whether the test was met.
vld_indices()
: Validate Indices
x <- list(c(2L, 1L)) chk_indices(x) y <- c(2L, 1L) try(chk_indices(y)) vld_indices(c(3L, 1L)) vld_indices(list(c(3L, 1L)))
x <- list(c(2L, 1L)) chk_indices(x) y <- c(2L, 1L) try(chk_indices(y)) vld_indices(c(3L, 1L)) vld_indices(list(c(3L, 1L)))
Checks if valid parameter names.
chk_pars(x, x_name = NULL) vld_pars(x)
chk_pars(x, x_name = NULL) vld_pars(x)
x |
An object. |
x_name |
A string of the name of object x or NULL. |
The character vector must consist of values that start with an alpha and only include alphanumeric characters and '_' or '.'.
Missing values and duplicates are permitted.
The chk_
function throws an informative error if the test fails.
The vld_
function returns a flag indicating whether the test was met.
vld_pars()
: Validate Parameter Names
x <- c("x", "a1._", "X") chk_pars(x) y <- c("x[1]", "a1", "a1", "._0") try(chk_pars(y)) vld_pars(c("x", "a1._", "X")) vld_pars(c("x[1]", "a1", "a1", "._0"))
x <- c("x", "a1._", "X") chk_pars(x) y <- c("x[1]", "a1", "a1", "._0") try(chk_pars(y)) vld_pars(c("x", "a1._", "X")) vld_pars(c("x[1]", "a1", "a1", "._0"))
Bernoulli Distribution
dbern(x, prob, log = FALSE) pbern(q, prob, lower.tail = TRUE, log = FALSE) qbern(p, prob, lower.tail = TRUE, log = FALSE) rbern(n, prob)
dbern(x, prob, log = FALSE) pbern(q, prob, lower.tail = TRUE, log = FALSE) qbern(p, prob, lower.tail = TRUE, log = FALSE) rbern(n, prob)
x |
A vector of 0s and 1s. |
prob |
A numeric vector of values between 0 and 1 of the probability of success. |
log |
A flag specifying whether to return the log-transformed value. |
q |
A vector of quantiles. |
lower.tail |
A flag specifying whether to return the lower or upper tail of the distribution. |
p |
A vector of probabilities. |
n |
A non-negative whole number of the number of random samples to generate. |
An numeric vector of the random samples.
dbern(1, 0.5) pbern(0.75, 0.5) qbern(0.1, 0.5) rbern(1, 0.5)
dbern(1, 0.5) pbern(0.75, 0.5) qbern(0.1, 0.5) rbern(1, 0.5)
Bernoulli Deviances
dev_bern(x, prob = 0.5, res = FALSE)
dev_bern(x, prob = 0.5, res = FALSE)
x |
A vector of 0s and 1s. |
prob |
A numeric vector of values between 0 and 1 of the probability of success. |
res |
A flag specifying whether to return the deviance residual as opposed to the deviance. |
An numeric vector of the corresponding deviances or deviance residuals.
Other dev_dist:
dev_beta_binom()
,
dev_binom()
,
dev_gamma()
,
dev_gamma_pois()
,
dev_lnorm()
,
dev_neg_binom()
,
dev_norm()
,
dev_pois()
,
dev_pois_zi()
,
dev_skewnorm()
,
dev_student()
dev_bern(c(TRUE, FALSE), 0.7)
dev_bern(c(TRUE, FALSE), 0.7)
This parameterization of the beta-binomial distribution uses an expected
probability parameter, prob
, and a dispersion parameter, theta
. The
parameters of the underlying beta mixture are alpha = (2 * prob) / theta
and beta = (2 * (1 - prob)) / theta
. This parameterization of theta
is
unconventional, but has useful properties when modelling. When theta = 0
,
the beta-binomial reverts to the binomial distribution. When theta = 1
and
prob = 0.5
, the parameters of the beta distribution become alpha = 1
and
beta = 1
, which correspond to a uniform distribution for the beta-binomial
probability parameter.
dev_beta_binom(x, size = 1, prob = 0.5, theta = 0, res = FALSE)
dev_beta_binom(x, size = 1, prob = 0.5, theta = 0, res = FALSE)
x |
A non-negative whole numeric vector of values. |
size |
A non-negative whole numeric vector of the number of trials. |
prob |
A numeric vector of values between 0 and 1 of the probability of success. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
res |
A flag specifying whether to return the deviance residual as opposed to the deviance. |
An numeric vector of the corresponding deviances or deviance residuals.
Other dev_dist:
dev_bern()
,
dev_binom()
,
dev_gamma()
,
dev_gamma_pois()
,
dev_lnorm()
,
dev_neg_binom()
,
dev_norm()
,
dev_pois()
,
dev_pois_zi()
,
dev_skewnorm()
,
dev_student()
dev_beta_binom(c(0, 1, 2), 10, 0.5, 0.1)
dev_beta_binom(c(0, 1, 2), 10, 0.5, 0.1)
Binomial Deviances
dev_binom(x, size = 1, prob = 0.5, res = FALSE)
dev_binom(x, size = 1, prob = 0.5, res = FALSE)
x |
A non-negative whole numeric vector of values. |
size |
A non-negative whole numeric vector of the number of trials. |
prob |
A numeric vector of values between 0 and 1 of the probability of success. |
res |
A flag specifying whether to return the deviance residual as opposed to the deviance. |
An numeric vector of the corresponding deviances or deviance residuals.
Other dev_dist:
dev_bern()
,
dev_beta_binom()
,
dev_gamma()
,
dev_gamma_pois()
,
dev_lnorm()
,
dev_neg_binom()
,
dev_norm()
,
dev_pois()
,
dev_pois_zi()
,
dev_skewnorm()
,
dev_student()
dev_binom(c(0, 1, 2), 2, 0.3)
dev_binom(c(0, 1, 2), 2, 0.3)
Gamma Deviances
dev_gamma(x, shape = 1, rate = 1, res = FALSE)
dev_gamma(x, shape = 1, rate = 1, res = FALSE)
x |
A numeric vector of values. |
shape |
A non-negative numeric vector of shape. |
rate |
A non-negative numeric vector of rate. |
res |
A flag specifying whether to return the deviance residual as opposed to the deviance. |
An numeric vector of the corresponding deviances or deviance residuals.
Other dev_dist:
dev_bern()
,
dev_beta_binom()
,
dev_binom()
,
dev_gamma_pois()
,
dev_lnorm()
,
dev_neg_binom()
,
dev_norm()
,
dev_pois()
,
dev_pois_zi()
,
dev_skewnorm()
,
dev_student()
dev_gamma(c(0, 1, 2), 1, 2)
dev_gamma(c(0, 1, 2), 1, 2)
Gamma-Poisson Deviances
dev_gamma_pois(x, lambda = 1, theta = 0, res = FALSE)
dev_gamma_pois(x, lambda = 1, theta = 0, res = FALSE)
x |
A non-negative whole numeric vector of values. |
lambda |
A non-negative numeric vector of means. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
res |
A flag specifying whether to return the deviance residual as opposed to the deviance. |
An numeric vector of the corresponding deviances or deviance residuals.
Other dev_dist:
dev_bern()
,
dev_beta_binom()
,
dev_binom()
,
dev_gamma()
,
dev_lnorm()
,
dev_neg_binom()
,
dev_norm()
,
dev_pois()
,
dev_pois_zi()
,
dev_skewnorm()
,
dev_student()
dev_gamma_pois(c(1, 3, 4), 3, 2)
dev_gamma_pois(c(1, 3, 4), 3, 2)
Zero-Inflated Gamma-Poisson Deviances
dev_gamma_pois_zi(x, lambda = 1, theta = 0, prob = 0, res = FALSE)
dev_gamma_pois_zi(x, lambda = 1, theta = 0, prob = 0, res = FALSE)
x |
A non-negative whole numeric vector of values. |
lambda |
A non-negative numeric vector of means. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
prob |
A numeric vector of values between 0 and 1 of the probability of success. |
res |
A flag specifying whether to return the deviance residual as opposed to the deviance. |
An numeric vector of the corresponding deviances or deviance residuals.
dev_gamma_pois_zi(c(1, 3, 4), 3, 2)
dev_gamma_pois_zi(c(1, 3, 4), 3, 2)
Log-Normal Deviances
dev_lnorm(x, meanlog = 0, sdlog = 1, res = FALSE)
dev_lnorm(x, meanlog = 0, sdlog = 1, res = FALSE)
x |
A numeric vector of values. |
meanlog |
A numeric vector of the means on the log scale. |
sdlog |
A non-negative numeric vector of the standard deviations on the log scale. |
res |
A flag specifying whether to return the deviance residual as opposed to the deviance. |
An numeric vector of the corresponding deviances or deviance residuals.
Other dev_dist:
dev_bern()
,
dev_beta_binom()
,
dev_binom()
,
dev_gamma()
,
dev_gamma_pois()
,
dev_neg_binom()
,
dev_norm()
,
dev_pois()
,
dev_pois_zi()
,
dev_skewnorm()
,
dev_student()
dev_lnorm(exp(-2:2))
dev_lnorm(exp(-2:2))
Negative Binomial Deviances
dev_neg_binom(x, lambda = 1, theta = 0, res = FALSE)
dev_neg_binom(x, lambda = 1, theta = 0, res = FALSE)
x |
A non-negative whole numeric vector of values. |
lambda |
A non-negative numeric vector of means. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
res |
A flag specifying whether to return the deviance residual as opposed to the deviance. |
An numeric vector of the corresponding deviances or deviance residuals.
Other dev_dist:
dev_bern()
,
dev_beta_binom()
,
dev_binom()
,
dev_gamma()
,
dev_gamma_pois()
,
dev_lnorm()
,
dev_norm()
,
dev_pois()
,
dev_pois_zi()
,
dev_skewnorm()
,
dev_student()
dev_neg_binom(c(1, 2, 5), 2, 3)
dev_neg_binom(c(1, 2, 5), 2, 3)
Normal Deviances
dev_norm(x, mean = 0, sd = 1, res = FALSE)
dev_norm(x, mean = 0, sd = 1, res = FALSE)
x |
A numeric vector of values. |
mean |
A numeric vector of the means. |
sd |
A non-negative numeric vector of the standard deviations. |
res |
A flag specifying whether to return the deviance residual as opposed to the deviance. |
An numeric vector of the corresponding deviances or deviance residuals.
Other dev_dist:
dev_bern()
,
dev_beta_binom()
,
dev_binom()
,
dev_gamma()
,
dev_gamma_pois()
,
dev_lnorm()
,
dev_neg_binom()
,
dev_pois()
,
dev_pois_zi()
,
dev_skewnorm()
,
dev_student()
dev_norm(c(-2:2))
dev_norm(c(-2:2))
Poisson Deviances
dev_pois(x, lambda, res = FALSE)
dev_pois(x, lambda, res = FALSE)
x |
A non-negative whole numeric vector of values. |
lambda |
A non-negative numeric vector of means. |
res |
A flag specifying whether to return the deviance residual as opposed to the deviance. |
An numeric vector of the corresponding deviances or deviance residuals.
Other dev_dist:
dev_bern()
,
dev_beta_binom()
,
dev_binom()
,
dev_gamma()
,
dev_gamma_pois()
,
dev_lnorm()
,
dev_neg_binom()
,
dev_norm()
,
dev_pois_zi()
,
dev_skewnorm()
,
dev_student()
dev_pois(c(1, 3, 4), 3)
dev_pois(c(1, 3, 4), 3)
Zero-Inflated Poisson Deviances
dev_pois_zi(x, lambda, prob = 0, res = FALSE)
dev_pois_zi(x, lambda, prob = 0, res = FALSE)
x |
A non-negative whole numeric vector of values. |
lambda |
A non-negative numeric vector of means. |
prob |
A numeric vector of values between 0 and 1 of the probability of success. |
res |
A flag specifying whether to return the deviance residual as opposed to the deviance. |
An numeric vector of the corresponding deviances or deviance residuals.
Other dev_dist:
dev_bern()
,
dev_beta_binom()
,
dev_binom()
,
dev_gamma()
,
dev_gamma_pois()
,
dev_lnorm()
,
dev_neg_binom()
,
dev_norm()
,
dev_pois()
,
dev_skewnorm()
,
dev_student()
dev_pois_zi(c(1, 3, 4), 3)
dev_pois_zi(c(1, 3, 4), 3)
Skew Normal Deviances
dev_skewnorm(x, mean = 0, sd = 1, shape = 0, res = FALSE)
dev_skewnorm(x, mean = 0, sd = 1, shape = 0, res = FALSE)
x |
A numeric vector of values. |
mean |
A numeric vector of the means. |
sd |
A non-negative numeric vector of the standard deviations. |
shape |
A numeric vector of shape. |
res |
A flag specifying whether to return the deviance residual as opposed to the deviance. |
An numeric vector of the corresponding deviances or deviance residuals.
Other dev_dist:
dev_bern()
,
dev_beta_binom()
,
dev_binom()
,
dev_gamma()
,
dev_gamma_pois()
,
dev_lnorm()
,
dev_neg_binom()
,
dev_norm()
,
dev_pois()
,
dev_pois_zi()
,
dev_student()
dev_skewnorm(c(-2:2)) dev_skewnorm(-2:2, 0, 1, 5) dev_skewnorm(-2:2, 0, 1, 5, res = TRUE)
dev_skewnorm(c(-2:2)) dev_skewnorm(-2:2, 0, 1, 5) dev_skewnorm(-2:2, 0, 1, 5, res = TRUE)
Student's t Deviances
dev_student(x, mean = 0, sd = 1, theta = 0, res = FALSE)
dev_student(x, mean = 0, sd = 1, theta = 0, res = FALSE)
x |
A numeric vector of values. |
mean |
A numeric vector of the means. |
sd |
A non-negative numeric vector of the standard deviations. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
res |
A flag specifying whether to return the deviance residual as opposed to the deviance. |
An numeric vector of the corresponding deviances or deviance residuals.
Other dev_dist:
dev_bern()
,
dev_beta_binom()
,
dev_binom()
,
dev_gamma()
,
dev_gamma_pois()
,
dev_lnorm()
,
dev_neg_binom()
,
dev_norm()
,
dev_pois()
,
dev_pois_zi()
,
dev_skewnorm()
dev_student(c(1, 3.5, 4), 3)
dev_student(c(1, 3.5, 4), 3)
Skew-Normal Distribution
dskewnorm(x, mean = 0, sd = 1, shape = 0, log = FALSE) pskewnorm(q, mean = 0, sd = 1, shape = 0) qskewnorm(p, mean = 0, sd = 1, shape = 0) rskewnorm(n = 1, mean = 0, sd = 1, shape = 0)
dskewnorm(x, mean = 0, sd = 1, shape = 0, log = FALSE) pskewnorm(q, mean = 0, sd = 1, shape = 0) qskewnorm(p, mean = 0, sd = 1, shape = 0) rskewnorm(n = 1, mean = 0, sd = 1, shape = 0)
x |
A numeric vector of values. |
mean |
A numeric vector of the means. |
sd |
A non-negative numeric vector of the standard deviations. |
shape |
A numeric vector of values. |
log |
A flag specifying whether to return the log-transformed value. |
q |
A vector of quantiles. |
p |
A vector of probabilities. |
n |
A non-negative whole number of the number of random samples to generate. |
dskewnorm
gives the density, pskewnorm
gives the distribution function, qskewnorm
gives the quantile function, and rskewnorm
generates random deviates.
pskewnorm
and qskewnorm
use the lower tail probability.
dskewnorm(x = -2:2, mean = 0, sd = 1, shape = 0.1) dskewnorm(x = -2:2, mean = 0, sd = 1, shape = -1) qskewnorm(p = c(0.1, 0.4), mean = 0, sd = 1, shape = 0.1) qskewnorm(p = c(0.1, 0.4), mean = 0, sd = 1, shape = -1) pskewnorm(q = -2:2, mean = 0, sd = 1, shape = 0.1) pskewnorm(q = -2:2, mean = 0, sd = 1, shape = -1) rskewnorm(n = 3, mean = 0, sd = 1, shape = 0.1) rskewnorm(n = 3, mean = 0, sd = 1, shape = -1)
dskewnorm(x = -2:2, mean = 0, sd = 1, shape = 0.1) dskewnorm(x = -2:2, mean = 0, sd = 1, shape = -1) qskewnorm(p = c(0.1, 0.4), mean = 0, sd = 1, shape = 0.1) qskewnorm(p = c(0.1, 0.4), mean = 0, sd = 1, shape = -1) pskewnorm(q = -2:2, mean = 0, sd = 1, shape = 0.1) pskewnorm(q = -2:2, mean = 0, sd = 1, shape = -1) rskewnorm(n = 3, mean = 0, sd = 1, shape = 0.1) rskewnorm(n = 3, mean = 0, sd = 1, shape = -1)
Returns the transformation of 10^x.
exp10(x)
exp10(x)
x |
An numeric atomic object. |
A numeric atomic object with the value of 10^x.
Other translations:
exp2()
,
fabs()
,
ilog()
,
ilog10()
,
ilog2()
,
ilogit()
,
inv_logit()
,
invlogit()
,
log10<-()
,
log2<-()
,
log<-()
,
logit()
,
logit<-()
,
phi()
,
pow()
,
step()
x <- c(5, 10.5) exp10(x)
x <- c(5, 10.5) exp10(x)
Returns the transformation of 2^x.
exp2(x)
exp2(x)
x |
An numeric atomic object. |
A numeric atomic object with the value of 2^x.
Other translations:
exp10()
,
fabs()
,
ilog()
,
ilog10()
,
ilog2()
,
ilogit()
,
inv_logit()
,
invlogit()
,
log10<-()
,
log2<-()
,
log<-()
,
logit()
,
logit<-()
,
phi()
,
pow()
,
step()
x <- c(5, 10.5) exp2(x)
x <- c(5, 10.5) exp2(x)
Computes the absolute value of x
.
Used in TMB as replacement for abs()
which is seemingly ambiguous.
fabs(x)
fabs(x)
x |
An existing R object. |
A wrapper on abs
()
.
A numeric vector of the corresponding absolute values.
Other translations:
exp10()
,
exp2()
,
ilog()
,
ilog10()
,
ilog2()
,
ilogit()
,
inv_logit()
,
invlogit()
,
log10<-()
,
log2<-()
,
log<-()
,
logit()
,
logit<-()
,
phi()
,
pow()
,
step()
fabs(c(0, -1, 2))
fabs(c(0, -1, 2))
Fills all of an object's (missing and non-missing) values while preserving the object's dimensionality and class.
fill_all(x, value, ...) ## S3 method for class 'logical' fill_all(x, value = FALSE, nas = TRUE, ...) ## S3 method for class 'integer' fill_all(x, value = 0L, nas = TRUE, ...) ## S3 method for class 'numeric' fill_all(x, value = 0, nas = TRUE, ...) ## S3 method for class 'character' fill_all(x, value = "0", nas = TRUE, ...)
fill_all(x, value, ...) ## S3 method for class 'logical' fill_all(x, value = FALSE, nas = TRUE, ...) ## S3 method for class 'integer' fill_all(x, value = 0L, nas = TRUE, ...) ## S3 method for class 'numeric' fill_all(x, value = 0, nas = TRUE, ...) ## S3 method for class 'character' fill_all(x, value = "0", nas = TRUE, ...)
x |
An object. |
value |
A scalar of the value to replace values with. |
... |
Other arguments passed to methods. |
nas |
A flag specifying whether to also fill missing values. |
It should only be defined for objects with values of consistent class ie not standard data.frames.
The modified object.
fill_all(logical)
: Fill All for logical Objects
fill_all(integer)
: Fill All for integer Objects
fill_all(numeric)
: Fill All for numeric Objects
fill_all(character)
: Fill All for character Objects
Other fill:
fill_na()
# logical fill_all(c(TRUE, NA, FALSE)) fill_all(c(TRUE, NA, FALSE, nas = FALSE)) fill_all(c(TRUE, NA, FALSE, value = NA)) # integer fill_all(matrix(1:4, nrow = 2), value = -1) # numeric fill_all(c(1, 4, NA), value = TRUE) fill_all(c(1, 4, NA), value = TRUE, nas = FALSE) # character fill_all(c("some", "words"), value = TRUE)
# logical fill_all(c(TRUE, NA, FALSE)) fill_all(c(TRUE, NA, FALSE, nas = FALSE)) fill_all(c(TRUE, NA, FALSE, value = NA)) # integer fill_all(matrix(1:4, nrow = 2), value = -1) # numeric fill_all(c(1, 4, NA), value = TRUE) fill_all(c(1, 4, NA), value = TRUE, nas = FALSE) # character fill_all(c("some", "words"), value = TRUE)
Fills all of an object's missing values while preserving the object's dimensionality and class.
fill_na(x, value, ...) ## S3 method for class 'logical' fill_na(x, value = FALSE, ...) ## S3 method for class 'integer' fill_na(x, value = 0L, ...) ## S3 method for class 'numeric' fill_na(x, value = 0, ...) ## S3 method for class 'character' fill_na(x, value = "0", ...)
fill_na(x, value, ...) ## S3 method for class 'logical' fill_na(x, value = FALSE, ...) ## S3 method for class 'integer' fill_na(x, value = 0L, ...) ## S3 method for class 'numeric' fill_na(x, value = 0, ...) ## S3 method for class 'character' fill_na(x, value = "0", ...)
x |
An object. |
value |
A scalar of the value to replace values with. |
... |
Other arguments passed to methods. |
It should only be defined for objects with values of consistent class ie not standard data.frames.
The modified object.
fill_na(logical)
: Fill Missing Values for logical Objects
fill_na(integer)
: Fill Missing Values for integer Objects
fill_na(numeric)
: Fill Missing Values for numeric Objects
fill_na(character)
: Fill Missing Values for character Objects
Other fill:
fill_all()
# logical fill_na(c(TRUE, NA)) # integer fill_na(c(1L, NA), 0) # numeric fill_na(c(1, NA), Inf) # character fill_na(c("text", NA)) fill_na(matrix(c("text", NA)), value = Inf)
# logical fill_na(c(TRUE, NA)) # integer fill_na(c(1L, NA), 0) # numeric fill_na(c(1, NA), Inf) # character fill_na(c("text", NA)) fill_na(matrix(c("text", NA)), value = Inf)
Inverse log transforms a numeric atomic object.
ilog(x)
ilog(x)
x |
An object. |
A wrapper on exp
(value)
.
A numeric atomic object.
Other translations:
exp10()
,
exp2()
,
fabs()
,
ilog10()
,
ilog2()
,
ilogit()
,
inv_logit()
,
invlogit()
,
log10<-()
,
log2<-()
,
log<-()
,
logit()
,
logit<-()
,
phi()
,
pow()
,
step()
x <- 1 ilog(x)
x <- 1 ilog(x)
Inverse log transforms a numeric atomic object with base 10.
ilog10(x)
ilog10(x)
x |
An object. |
A wrapper on exp10
(value)
.
A numeric atomic object.
Other translations:
exp10()
,
exp2()
,
fabs()
,
ilog()
,
ilog2()
,
ilogit()
,
inv_logit()
,
invlogit()
,
log10<-()
,
log2<-()
,
log<-()
,
logit()
,
logit<-()
,
phi()
,
pow()
,
step()
x <- c(2, 4.5) ilog10(x)
x <- c(2, 4.5) ilog10(x)
Inverse log transforms a numeric atomic object with base 2.
ilog2(x)
ilog2(x)
x |
An object. |
A wrapper on exp2
(value)
.
A numeric atomic object.
Other translations:
exp10()
,
exp2()
,
fabs()
,
ilog()
,
ilog10()
,
ilogit()
,
inv_logit()
,
invlogit()
,
log10<-()
,
log2<-()
,
log<-()
,
logit()
,
logit<-()
,
phi()
,
pow()
,
step()
x <- c(2, 4.5) ilog2(x)
x <- c(2, 4.5) ilog2(x)
Inverse logistically transforms a numeric atomic object.
ilogit(x)
ilogit(x)
x |
A numeric atomic object. |
A wrapper on stats::plogis()
.
A numeric atomic object.
Other translations:
exp10()
,
exp2()
,
fabs()
,
ilog()
,
ilog10()
,
ilog2()
,
inv_logit()
,
invlogit()
,
log10<-()
,
log2<-()
,
log<-()
,
logit()
,
logit<-()
,
phi()
,
pow()
,
step()
ilogit(c(-1, 0, 5))
ilogit(c(-1, 0, 5))
Inverse logistically transforms a numeric atomic object.
inv_logit(x)
inv_logit(x)
x |
A numeric atomic object. |
A wrapper on stats::plogis()
.
A numeric atomic object.
Other translations:
exp10()
,
exp2()
,
fabs()
,
ilog()
,
ilog10()
,
ilog2()
,
ilogit()
,
invlogit()
,
log10<-()
,
log2<-()
,
log<-()
,
logit()
,
logit<-()
,
phi()
,
pow()
,
step()
inv_logit(c(-1, 0, 5))
inv_logit(c(-1, 0, 5))
Calculates the probabilities for odds.
inv_odds(x)
inv_odds(x)
x |
A numeric object (vector, matrix or array) of odds. |
A numeric object of the the probabilities for each odd.
Other odds:
log_odds()
,
log_odds<-()
,
log_odds_ratio()
,
odds()
,
odds<-()
,
odds_ratio()
inv_odds(c(0, 1, 9, 9999))
inv_odds(c(0, 1, 9, 9999))
Inverse logistically transforms a numeric atomic object.
invlogit(x)
invlogit(x)
x |
A numeric atomic object. |
A wrapper on stats::plogis()
.
A numeric atomic object.
Other translations:
exp10()
,
exp2()
,
fabs()
,
ilog()
,
ilog10()
,
ilog2()
,
ilogit()
,
inv_logit()
,
log10<-()
,
log2<-()
,
log<-()
,
logit()
,
logit<-()
,
phi()
,
pow()
,
step()
invlogit(c(-1, 0, 5))
invlogit(c(-1, 0, 5))
Kurtosis
kurtosis(x, na_rm = FALSE)
kurtosis(x, na_rm = FALSE)
x |
A numeric object of MCMC values. |
na_rm |
A flag specifying whether to remove missing values. |
A number.
Other summary:
lower()
,
pvalue()
,
pzeros()
,
skewness()
,
svalue()
,
upper()
,
variance()
,
xtr_mean()
,
xtr_median()
,
xtr_sd()
,
zeros()
,
zscore()
kurtosis(1:10)
kurtosis(1:10)
Bernoulli Log-Likelihood
log_lik_bern(x, prob = 0.5)
log_lik_bern(x, prob = 0.5)
x |
A vector of 0s and 1s. |
prob |
A numeric vector of values between 0 and 1 of the probability of success. |
An numeric vector of the corresponding log-likelihoods.
Other log_lik_dist:
log_lik_beta_binom()
,
log_lik_binom()
,
log_lik_gamma()
,
log_lik_gamma_pois()
,
log_lik_gamma_pois_zi()
,
log_lik_lnorm()
,
log_lik_neg_binom()
,
log_lik_norm()
,
log_lik_pois()
,
log_lik_pois_zi()
,
log_lik_skewnorm()
,
log_lik_student()
log_lik_bern(c(TRUE, FALSE), 0.7)
log_lik_bern(c(TRUE, FALSE), 0.7)
This parameterization of the beta-binomial distribution uses an expected
probability parameter, prob
, and a dispersion parameter, theta
. The
parameters of the underlying beta mixture are alpha = (2 * prob) / theta
and beta = (2 * (1 - prob)) / theta
. This parameterization of theta
is
unconventional, but has useful properties when modelling. When theta = 0
,
the beta-binomial reverts to the binomial distribution. When theta = 1
and
prob = 0.5
, the parameters of the beta distribution become alpha = 1
and
beta = 1
, which correspond to a uniform distribution for the beta-binomial
probability parameter.
log_lik_beta_binom(x, size = 1, prob = 0.5, theta = 0)
log_lik_beta_binom(x, size = 1, prob = 0.5, theta = 0)
x |
A non-negative whole numeric vector of values. |
size |
A non-negative whole numeric vector of the number of trials. |
prob |
A numeric vector of values between 0 and 1 of the probability of success. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
An numeric vector of the corresponding log-likelihoods.
Other log_lik_dist:
log_lik_bern()
,
log_lik_binom()
,
log_lik_gamma()
,
log_lik_gamma_pois()
,
log_lik_gamma_pois_zi()
,
log_lik_lnorm()
,
log_lik_neg_binom()
,
log_lik_norm()
,
log_lik_pois()
,
log_lik_pois_zi()
,
log_lik_skewnorm()
,
log_lik_student()
log_lik_beta_binom(c(0, 1, 2), 3, 0.5, 0)
log_lik_beta_binom(c(0, 1, 2), 3, 0.5, 0)
Binomial Log-Likelihood
log_lik_binom(x, size = 1, prob = 0.5)
log_lik_binom(x, size = 1, prob = 0.5)
x |
A non-negative whole numeric vector of values. |
size |
A non-negative whole numeric vector of the number of trials. |
prob |
A numeric vector of values between 0 and 1 of the probability of success. |
An numeric vector of the corresponding log-likelihoods.
Other log_lik_dist:
log_lik_bern()
,
log_lik_beta_binom()
,
log_lik_gamma()
,
log_lik_gamma_pois()
,
log_lik_gamma_pois_zi()
,
log_lik_lnorm()
,
log_lik_neg_binom()
,
log_lik_norm()
,
log_lik_pois()
,
log_lik_pois_zi()
,
log_lik_skewnorm()
,
log_lik_student()
log_lik_binom(c(0, 1, 2), 2, 0.3)
log_lik_binom(c(0, 1, 2), 2, 0.3)
Gamma Log-Likelihood
log_lik_gamma(x, shape = 1, rate = 1)
log_lik_gamma(x, shape = 1, rate = 1)
x |
A numeric vector of values. |
shape |
A non-negative numeric vector of shape. |
rate |
A non-negative numeric vector of rate. |
An numeric vector of the corresponding log-likelihoods.
Other log_lik_dist:
log_lik_bern()
,
log_lik_beta_binom()
,
log_lik_binom()
,
log_lik_gamma_pois()
,
log_lik_gamma_pois_zi()
,
log_lik_lnorm()
,
log_lik_neg_binom()
,
log_lik_norm()
,
log_lik_pois()
,
log_lik_pois_zi()
,
log_lik_skewnorm()
,
log_lik_student()
log_lik_gamma(c(0, 1, 2), 1, 2)
log_lik_gamma(c(0, 1, 2), 1, 2)
Gamma-Poisson Log-Likelihood
log_lik_gamma_pois(x, lambda = 1, theta = 0)
log_lik_gamma_pois(x, lambda = 1, theta = 0)
x |
A non-negative whole numeric vector of values. |
lambda |
A non-negative numeric vector of means. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
An numeric vector of the corresponding log-likelihoods.
Other log_lik_dist:
log_lik_bern()
,
log_lik_beta_binom()
,
log_lik_binom()
,
log_lik_gamma()
,
log_lik_gamma_pois_zi()
,
log_lik_lnorm()
,
log_lik_neg_binom()
,
log_lik_norm()
,
log_lik_pois()
,
log_lik_pois_zi()
,
log_lik_skewnorm()
,
log_lik_student()
log_lik_gamma_pois(c(0, 1, 2), 1, 1)
log_lik_gamma_pois(c(0, 1, 2), 1, 1)
Zero-Inflated Gamma-Poisson Log-Likelihood
log_lik_gamma_pois_zi(x, lambda = 1, theta = 0, prob = 0)
log_lik_gamma_pois_zi(x, lambda = 1, theta = 0, prob = 0)
x |
A non-negative whole numeric vector of values. |
lambda |
A non-negative numeric vector of means. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
prob |
A numeric vector of values between 0 and 1 of the probability of success. |
An numeric vector of the corresponding log-likelihoods.
Other log_lik_dist:
log_lik_bern()
,
log_lik_beta_binom()
,
log_lik_binom()
,
log_lik_gamma()
,
log_lik_gamma_pois()
,
log_lik_lnorm()
,
log_lik_neg_binom()
,
log_lik_norm()
,
log_lik_pois()
,
log_lik_pois_zi()
,
log_lik_skewnorm()
,
log_lik_student()
log_lik_gamma_pois_zi(c(1, 3, 4), 3, 1, prob = 0.5)
log_lik_gamma_pois_zi(c(1, 3, 4), 3, 1, prob = 0.5)
Log-Normal Log-Likelihood
log_lik_lnorm(x, meanlog = 0, sdlog = 1)
log_lik_lnorm(x, meanlog = 0, sdlog = 1)
x |
A numeric vector of values. |
meanlog |
A numeric vector of the means on the log scale. |
sdlog |
A non-negative numeric vector of the standard deviations on the log scale. |
An numeric vector of the corresponding log-likelihoods.
Other log_lik_dist:
log_lik_bern()
,
log_lik_beta_binom()
,
log_lik_binom()
,
log_lik_gamma()
,
log_lik_gamma_pois()
,
log_lik_gamma_pois_zi()
,
log_lik_neg_binom()
,
log_lik_norm()
,
log_lik_pois()
,
log_lik_pois_zi()
,
log_lik_skewnorm()
,
log_lik_student()
log_lik_lnorm(10, 0, 2)
log_lik_lnorm(10, 0, 2)
Negative Binomial Log-Likelihood
log_lik_neg_binom(x, lambda = 1, theta = 0)
log_lik_neg_binom(x, lambda = 1, theta = 0)
x |
A non-negative whole numeric vector of values. |
lambda |
A non-negative numeric vector of means. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
An numeric vector of the corresponding log-likelihoods.
Other log_lik_dist:
log_lik_bern()
,
log_lik_beta_binom()
,
log_lik_binom()
,
log_lik_gamma()
,
log_lik_gamma_pois()
,
log_lik_gamma_pois_zi()
,
log_lik_lnorm()
,
log_lik_norm()
,
log_lik_pois()
,
log_lik_pois_zi()
,
log_lik_skewnorm()
,
log_lik_student()
log_lik_neg_binom(c(0, 1, 2), 2, 1)
log_lik_neg_binom(c(0, 1, 2), 2, 1)
Normal Log-Likelihood
log_lik_norm(x, mean = 0, sd = 1)
log_lik_norm(x, mean = 0, sd = 1)
x |
A numeric vector of values. |
mean |
A numeric vector of the means. |
sd |
A non-negative numeric vector of the standard deviations. |
An numeric vector of the corresponding log-likelihoods.
Other log_lik_dist:
log_lik_bern()
,
log_lik_beta_binom()
,
log_lik_binom()
,
log_lik_gamma()
,
log_lik_gamma_pois()
,
log_lik_gamma_pois_zi()
,
log_lik_lnorm()
,
log_lik_neg_binom()
,
log_lik_pois()
,
log_lik_pois_zi()
,
log_lik_skewnorm()
,
log_lik_student()
log_lik_norm(c(-2:2))
log_lik_norm(c(-2:2))
Poisson Log-Likelihood
log_lik_pois(x, lambda = 1)
log_lik_pois(x, lambda = 1)
x |
A non-negative whole numeric vector of values. |
lambda |
A non-negative numeric vector of means. |
An numeric vector of the corresponding log-likelihoods.
Other log_lik_dist:
log_lik_bern()
,
log_lik_beta_binom()
,
log_lik_binom()
,
log_lik_gamma()
,
log_lik_gamma_pois()
,
log_lik_gamma_pois_zi()
,
log_lik_lnorm()
,
log_lik_neg_binom()
,
log_lik_norm()
,
log_lik_pois_zi()
,
log_lik_skewnorm()
,
log_lik_student()
log_lik_pois(c(1, 3, 4), 3)
log_lik_pois(c(1, 3, 4), 3)
Zero-Inflated Poisson Log-Likelihood
log_lik_pois_zi(x, lambda = 1, prob = 0)
log_lik_pois_zi(x, lambda = 1, prob = 0)
x |
A non-negative whole numeric vector of values. |
lambda |
A non-negative numeric vector of means. |
prob |
A numeric vector of values between 0 and 1 of the probability of success. |
An numeric vector of the corresponding log-likelihoods.
Other log_lik_dist:
log_lik_bern()
,
log_lik_beta_binom()
,
log_lik_binom()
,
log_lik_gamma()
,
log_lik_gamma_pois()
,
log_lik_gamma_pois_zi()
,
log_lik_lnorm()
,
log_lik_neg_binom()
,
log_lik_norm()
,
log_lik_pois()
,
log_lik_skewnorm()
,
log_lik_student()
log_lik_pois_zi(c(1, 3, 4), 3, prob = 0.5)
log_lik_pois_zi(c(1, 3, 4), 3, prob = 0.5)
Skew Normal Log-Likelihood
log_lik_skewnorm(x, mean = 0, sd = 1, shape = 0)
log_lik_skewnorm(x, mean = 0, sd = 1, shape = 0)
x |
A numeric vector of values. |
mean |
A numeric vector of the means. |
sd |
A non-negative numeric vector of the standard deviations. |
shape |
A numeric vector of shape. |
An numeric vector of the corresponding log-likelihoods.
Other log_lik_dist:
log_lik_bern()
,
log_lik_beta_binom()
,
log_lik_binom()
,
log_lik_gamma()
,
log_lik_gamma_pois()
,
log_lik_gamma_pois_zi()
,
log_lik_lnorm()
,
log_lik_neg_binom()
,
log_lik_norm()
,
log_lik_pois()
,
log_lik_pois_zi()
,
log_lik_student()
log_lik_skewnorm(c(-2:2)) log_lik_skewnorm(c(-2:2), shape = -2) log_lik_skewnorm(c(-2:2), shape = 2)
log_lik_skewnorm(c(-2:2)) log_lik_skewnorm(c(-2:2), shape = -2) log_lik_skewnorm(c(-2:2), shape = 2)
Student's t Log-Likelihood
log_lik_student(x, mean = 0, sd = 1, theta = 0)
log_lik_student(x, mean = 0, sd = 1, theta = 0)
x |
A numeric vector of values. |
mean |
A numeric vector of the means. |
sd |
A non-negative numeric vector of the standard deviations. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
An numeric vector of the corresponding log-likelihoods.
Other log_lik_dist:
log_lik_bern()
,
log_lik_beta_binom()
,
log_lik_binom()
,
log_lik_gamma()
,
log_lik_gamma_pois()
,
log_lik_gamma_pois_zi()
,
log_lik_lnorm()
,
log_lik_neg_binom()
,
log_lik_norm()
,
log_lik_pois()
,
log_lik_pois_zi()
,
log_lik_skewnorm()
log_lik_student(c(1, 3.5, 4), mean = 1, sd = 2, theta = 1 / 3)
log_lik_student(c(1, 3.5, 4), mean = 1, sd = 2, theta = 1 / 3)
Calculates the log odds for probabilities.
log_odds(x)
log_odds(x)
x |
A numeric object (vector, matrix or array) of probabilities. |
A numeric object of the the log odds for each probability.
Other odds:
inv_odds()
,
log_odds<-()
,
log_odds_ratio()
,
odds()
,
odds<-()
,
odds_ratio()
log_odds(c(0, 0.5, 0.9, 1))
log_odds(c(0, 0.5, 0.9, 1))
Calculates the log odds ratio for two probabilities.
log_odds_ratio(x, x2)
log_odds_ratio(x, x2)
x |
A numeric object (vector, matrix or array) of probabilities. |
x2 |
A second numeric object of probabilities. |
A numeric object of the log odds ratios.
Other odds:
inv_odds()
,
log_odds()
,
log_odds<-()
,
odds()
,
odds<-()
,
odds_ratio()
log_odds_ratio(0.5, 0.75)
log_odds_ratio(0.5, 0.75)
Calculates the log odds ratio for a vector of two probabilities.
log_odds_ratio2(x)
log_odds_ratio2(x)
x |
A numeric vector of length 2. |
A number.
Other odds fun2:
odds_ratio2()
log_odds_ratio2(c(0.5, 0.9)) log_odds_ratio2(c(0.9, 0.5))
log_odds_ratio2(c(0.5, 0.9)) log_odds_ratio2(c(0.9, 0.5))
Replaces an object with the inverse log odds of value.
log_odds(x) <- value
log_odds(x) <- value
x |
An existing R object. |
value |
A numeric atomic object. |
Called for the side effect of updating x
.
Other odds:
inv_odds()
,
log_odds()
,
log_odds_ratio()
,
odds()
,
odds<-()
,
odds_ratio()
x <- NULL log_odds(x) <- 0.5 x
x <- NULL log_odds(x) <- 0.5 x
Replaces a object with the exponent of value.
log(x) <- value
log(x) <- value
x |
An object. |
value |
A numeric atomic object. |
A wrapper on exp
(value)
.
Called for the side effect of updating x
.
Other translations:
exp10()
,
exp2()
,
fabs()
,
ilog()
,
ilog10()
,
ilog2()
,
ilogit()
,
inv_logit()
,
invlogit()
,
log10<-()
,
log2<-()
,
logit()
,
logit<-()
,
phi()
,
pow()
,
step()
x <- NULL log(x) <- 0.5 x
x <- NULL log(x) <- 0.5 x
Replaces a object with the base 10 exponent of value.
log10(x) <- value
log10(x) <- value
x |
An object. |
value |
A numeric atomic object. |
A wrapper on exp10
(value)
.
Called for the side effect of updating x
.
Other translations:
exp10()
,
exp2()
,
fabs()
,
ilog()
,
ilog10()
,
ilog2()
,
ilogit()
,
inv_logit()
,
invlogit()
,
log2<-()
,
log<-()
,
logit()
,
logit<-()
,
phi()
,
pow()
,
step()
x <- NULL log10(x) <- c(0.5, 5) x
x <- NULL log10(x) <- c(0.5, 5) x
Replaces a object with the base 2 exponent of value.
log2(x) <- value
log2(x) <- value
x |
An object. |
value |
A numeric atomic object. |
A wrapper on exp2
(value)
.
Called for the side effect of updating x
.
Other translations:
exp10()
,
exp2()
,
fabs()
,
ilog()
,
ilog10()
,
ilog2()
,
ilogit()
,
inv_logit()
,
invlogit()
,
log10<-()
,
log<-()
,
logit()
,
logit<-()
,
phi()
,
pow()
,
step()
x <- NULL log2(x) <- c(0.5, 5) x
x <- NULL log2(x) <- c(0.5, 5) x
Logistic transforms a numeric atomic object.
logit(x)
logit(x)
x |
A numeric atomic object. |
A wrapper on stats::qlogis()
.
The logistically transformed numeric atomic object.
Other translations:
exp10()
,
exp2()
,
fabs()
,
ilog()
,
ilog10()
,
ilog2()
,
ilogit()
,
inv_logit()
,
invlogit()
,
log10<-()
,
log2<-()
,
log<-()
,
logit<-()
,
phi()
,
pow()
,
step()
logit(c(0.25, 0.5, 0.75))
logit(c(0.25, 0.5, 0.75))
Logistic Transformation
logit(x) <- value
logit(x) <- value
x |
An existing object. |
value |
A numeric atomic object of the value to inverse logistically transform. |
A wrapper on stats::plogis(value)
.
Called for the side effect of updating x
.
Other translations:
exp10()
,
exp2()
,
fabs()
,
ilog()
,
ilog10()
,
ilog2()
,
ilogit()
,
inv_logit()
,
invlogit()
,
log10<-()
,
log2<-()
,
log<-()
,
logit()
,
phi()
,
pow()
,
step()
x <- 1 logit(x) <- 0.5 x
x <- 1 logit(x) <- 0.5 x
Calculates the quantile-based lower credible limit.
lower(x, conf_level = 0.95, na_rm = FALSE)
lower(x, conf_level = 0.95, na_rm = FALSE)
x |
A numeric vector of MCMC values. |
conf_level |
A numeric scalar between 0 and 1 specifying the confidence level. |
na_rm |
A flag specifying whether to remove missing values. |
By default it returns the 95% credible limit which corresponds to the 2.5% quantile.
A number.
Other summary:
kurtosis()
,
pvalue()
,
pzeros()
,
skewness()
,
svalue()
,
upper()
,
variance()
,
xtr_mean()
,
xtr_median()
,
xtr_sd()
,
zeros()
,
zscore()
lower(as.numeric(0:100))
lower(as.numeric(0:100))
Coerce an R object to a numeric atomic object.
numericise(x, ...) numericize(x, ...) ## S3 method for class 'logical' numericise(x, ...) ## S3 method for class 'integer' numericise(x, ...) ## S3 method for class 'double' numericise(x, ...) ## S3 method for class 'factor' numericise(x, ...) ## S3 method for class 'Date' numericise(x, ...) ## S3 method for class 'POSIXct' numericise(x, ...) ## S3 method for class 'hms' numericise(x, ...) ## S3 method for class 'matrix' numericise(x, ...) ## S3 method for class 'array' numericise(x, ...) ## S3 method for class 'data.frame' numericise(x, ...)
numericise(x, ...) numericize(x, ...) ## S3 method for class 'logical' numericise(x, ...) ## S3 method for class 'integer' numericise(x, ...) ## S3 method for class 'double' numericise(x, ...) ## S3 method for class 'factor' numericise(x, ...) ## S3 method for class 'Date' numericise(x, ...) ## S3 method for class 'POSIXct' numericise(x, ...) ## S3 method for class 'hms' numericise(x, ...) ## S3 method for class 'matrix' numericise(x, ...) ## S3 method for class 'array' numericise(x, ...) ## S3 method for class 'data.frame' numericise(x, ...)
x |
An object. |
... |
Other arguments passed to methods. |
numericize()
is an alias for numericise.
If you want to implement a method for a class "foo"
, implement
numericise.foo()
.
A numeric atomic object.
numericise(logical)
: Numericise a logical Object
numericise(integer)
: Numericise an integer Object
numericise(double)
: Numericise an double Object
numericise(factor)
: Numericise a factor
numericise(Date)
: Numericise a Date vector
numericise(POSIXct)
: Numericise a POSIXct vector
numericise(hms)
: Numericise a hms vector
numericise(matrix)
: Numericise a matrix
numericise(array)
: Numericise an array
numericise(data.frame)
: Numericise a data.frame
# logical numericise(TRUE) numericise(matrix(c(TRUE, FALSE), nrow = 2)) # integer numericise(2L) # double numericise(c(1, 3)) # factor numericise(factor(c("c", "a"))) # Date numericise(as.Date("1972-01-01")) # POSIXct numericise(as.POSIXct("1972-01-01", tz = "UTC")) # hms numericise(hms::as_hms("00:01:03")) # matrix numericise(matrix(TRUE)) # array numericise(array(TRUE)) # data.frame numericise(data.frame( logical = c(TRUE, FALSE, NA), integer = 1:3, numeric = c(4, 10, NA), factor = as.factor(c("c", "A", "green")) ))
# logical numericise(TRUE) numericise(matrix(c(TRUE, FALSE), nrow = 2)) # integer numericise(2L) # double numericise(c(1, 3)) # factor numericise(factor(c("c", "a"))) # Date numericise(as.Date("1972-01-01")) # POSIXct numericise(as.POSIXct("1972-01-01", tz = "UTC")) # hms numericise(hms::as_hms("00:01:03")) # matrix numericise(matrix(TRUE)) # array numericise(array(TRUE)) # data.frame numericise(data.frame( logical = c(TRUE, FALSE, NA), integer = 1:3, numeric = c(4, 10, NA), factor = as.factor(c("c", "A", "green")) ))
Calculates the odds for probabilities.
odds(x)
odds(x)
x |
A numeric object (vector, matrix or array) of probabilities. |
A numeric object of the the odds for each probability.
Other odds:
inv_odds()
,
log_odds()
,
log_odds<-()
,
log_odds_ratio()
,
odds<-()
,
odds_ratio()
odds(c(0, 0.5, 0.9, 1))
odds(c(0, 0.5, 0.9, 1))
Calculates the odds ratio for two probabilities.
odds_ratio(x, x2)
odds_ratio(x, x2)
x |
A numeric object (vector, matrix or array) of probabilities. |
x2 |
A second numeric object of probabilities. |
A numeric object of the odds ratios.
Other odds:
inv_odds()
,
log_odds()
,
log_odds<-()
,
log_odds_ratio()
,
odds()
,
odds<-()
odds_ratio(0.5, 0.75)
odds_ratio(0.5, 0.75)
Calculates the odds ratio for a vector of two probabilities.
odds_ratio2(x)
odds_ratio2(x)
x |
A numeric vector of length 2. |
A number.
Other odds fun2:
log_odds_ratio2()
odds_ratio2(c(0.5, 0.9)) odds_ratio2(c(0.9, 0.5))
odds_ratio2(c(0.5, 0.9)) odds_ratio2(c(0.9, 0.5))
Replaces an object with the inverse odds of value.
odds(x) <- value
odds(x) <- value
x |
An existing R object. |
value |
A numeric atomic object. |
Called for the side effect of updating x
.
Other odds:
inv_odds()
,
log_odds()
,
log_odds<-()
,
log_odds_ratio()
,
odds()
,
odds_ratio()
x <- NULL odds(x) <- 0.5 x
x <- NULL odds(x) <- 0.5 x
Parameter Pattern
par_pattern()
par_pattern()
A string of the regular expression for a parameter name.
par_pattern()
par_pattern()
Calculates the probability that a cumulative distribution function probability is at least that extreme.
pextreme(x)
pextreme(x)
x |
A numeric vector of values between 0 and 1. |
A numeric vector of values between 0 and 1.
Other residuals:
sextreme()
pextreme(seq(0, 1, by = 0.1))
pextreme(seq(0, 1, by = 0.1))
The standard normal cumulative density function.
phi(x)
phi(x)
x |
A numeric atomic object. |
A wrapper on stats::pnorm()
.
A numeric atomic object.
Other translations:
exp10()
,
exp2()
,
fabs()
,
ilog()
,
ilog10()
,
ilog2()
,
ilogit()
,
inv_logit()
,
invlogit()
,
log10<-()
,
log2<-()
,
log<-()
,
logit()
,
logit<-()
,
pow()
,
step()
phi(0:2)
phi(0:2)
R equivalent to the power function.
pow(x, n)
pow(x, n)
x |
A numeric atomic object of the base. |
n |
A numeric atomic object of the exponent. |
Wrapper on x^n
.
A numeric atomic object of x raised to n.
Other translations:
exp10()
,
exp2()
,
fabs()
,
ilog()
,
ilog10()
,
ilog2()
,
ilogit()
,
inv_logit()
,
invlogit()
,
log10<-()
,
log2<-()
,
log<-()
,
logit()
,
logit<-()
,
phi()
,
step()
pow(10, 2)
pow(10, 2)
Calculates the proportional change for two sets of numbers.
proportional_change(x, x2)
proportional_change(x, x2)
x |
A numeric object (vector, matrix or array) of non-negative numbers. |
x2 |
A second numeric object of non-negative numbers. |
A numeric object of the proportional change.
Other proportional:
proportional_difference()
proportional_change(1, 2) proportional_change(2, 1)
proportional_change(1, 2) proportional_change(2, 1)
Calculates the proportional change for a vector of two non-negative numbers.
proportional_change2(x)
proportional_change2(x)
x |
A numeric vector of length 2. |
A number.
Other proportional fun2:
proportional_difference2()
proportional_change2(c(1, 2)) proportional_change2(c(2, 1))
proportional_change2(c(1, 2)) proportional_change2(c(2, 1))
Calculates the proportional difference for two sets of numbers.
proportional_difference(x, x2)
proportional_difference(x, x2)
x |
A numeric object (vector, matrix or array) of non-negative numbers. |
x2 |
A second numeric object of non-negative numbers. |
A numeric object of the proportional change.
Other proportional:
proportional_change()
proportional_difference(1, 2) proportional_difference(2, 1)
proportional_difference(1, 2) proportional_difference(2, 1)
Calculates the proportional difference for a vector of two non-negative numbers.
proportional_difference2(x)
proportional_difference2(x)
x |
A numeric vector of length 2. |
A number.
Other proportional fun2:
proportional_change2()
proportional_difference2(c(1, 2)) proportional_difference2(c(2, 1))
proportional_difference2(c(1, 2)) proportional_difference2(c(2, 1))
A Bayesian p-value (p) is here defined in terms of the quantile-based (1-p) * 100% credible interval (CRI) that just includes a threshold (Kery and Schaub 2011). By default a p-value of 0.05 indicates that the 95% CRI just includes 0.
pvalue(x, threshold = 0, na_rm = FALSE)
pvalue(x, threshold = 0, na_rm = FALSE)
x |
A numeric vector of MCMC values. |
threshold |
A number of the threshold value. |
na_rm |
A flag specifying whether to remove missing values. |
A number between 0 and 1.
Kery, M., and Schaub, M. 2011. Bayesian population analysis using WinBUGS: a hierarchical perspective. Academic Press, Boston. Available from https://www.vogelwarte.ch/en/research/population-biology/book-bpa/.
Other summary:
kurtosis()
,
lower()
,
pzeros()
,
skewness()
,
svalue()
,
upper()
,
variance()
,
xtr_mean()
,
xtr_median()
,
xtr_sd()
,
zeros()
,
zscore()
pvalue(as.numeric(0:100))
pvalue(as.numeric(0:100))
The proportion of zeros in an numeric object.
pzeros(x, na_rm = FALSE)
pzeros(x, na_rm = FALSE)
x |
A numeric object of MCMC values. |
na_rm |
A flag specifying whether to remove missing values. |
A number between 0 and 1.
Other summary:
kurtosis()
,
lower()
,
pvalue()
,
skewness()
,
svalue()
,
upper()
,
variance()
,
xtr_mean()
,
xtr_median()
,
xtr_sd()
,
zeros()
,
zscore()
pzeros(c(0:2))
pzeros(c(0:2))
Bernoulli Random Samples
ran_bern(n = 1, prob = 0.5)
ran_bern(n = 1, prob = 0.5)
n |
A non-negative whole number of the number of random samples to generate. |
prob |
A numeric vector of values between 0 and 1 of the probability of success. |
A numeric vector of the random samples.
Other ran_dist:
ran_beta_binom()
,
ran_binom()
,
ran_gamma()
,
ran_gamma_pois()
,
ran_gamma_pois_zi()
,
ran_lnorm()
,
ran_neg_binom()
,
ran_norm()
,
ran_pois()
,
ran_pois_zi()
,
ran_skewnorm()
,
ran_student()
ran_bern(10)
ran_bern(10)
This parameterization of the beta-binomial distribution uses an expected
probability parameter, prob
, and a dispersion parameter, theta
. The
parameters of the underlying beta mixture are alpha = (2 * prob) / theta
and beta = (2 * (1 - prob)) / theta
. This parameterization of theta
is
unconventional, but has useful properties when modelling. When theta = 0
,
the beta-binomial reverts to the binomial distribution. When theta = 1
and
prob = 0.5
, the parameters of the beta distribution become alpha = 1
and
beta = 1
, which correspond to a uniform distribution for the beta-binomial
probability parameter.
ran_beta_binom(n = 1, size = 1, prob = 0.5, theta = 0)
ran_beta_binom(n = 1, size = 1, prob = 0.5, theta = 0)
n |
A non-negative whole number of the number of random samples to generate. |
size |
A non-negative whole numeric vector of the number of trials. |
prob |
A numeric vector of values between 0 and 1 of the probability of success. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
A numeric vector of the random samples.
Other ran_dist:
ran_bern()
,
ran_binom()
,
ran_gamma()
,
ran_gamma_pois()
,
ran_gamma_pois_zi()
,
ran_lnorm()
,
ran_neg_binom()
,
ran_norm()
,
ran_pois()
,
ran_pois_zi()
,
ran_skewnorm()
,
ran_student()
ran_beta_binom(10, 1, 0.5, 0)
ran_beta_binom(10, 1, 0.5, 0)
Binomial Random Samples
ran_binom(n = 1, size = 1, prob = 0.5)
ran_binom(n = 1, size = 1, prob = 0.5)
n |
A non-negative whole number of the number of random samples to generate. |
size |
A non-negative whole numeric vector of the number of trials. |
prob |
A numeric vector of values between 0 and 1 of the probability of success. |
A numeric vector of the random samples.
Other ran_dist:
ran_bern()
,
ran_beta_binom()
,
ran_gamma()
,
ran_gamma_pois()
,
ran_gamma_pois_zi()
,
ran_lnorm()
,
ran_neg_binom()
,
ran_norm()
,
ran_pois()
,
ran_pois_zi()
,
ran_skewnorm()
,
ran_student()
ran_binom(10)
ran_binom(10)
Gamma Random Samples
ran_gamma(n = 1, shape = 1, rate = 1)
ran_gamma(n = 1, shape = 1, rate = 1)
n |
A non-negative whole number of the number of random samples to generate. |
shape |
A non-negative numeric vector of shape. |
rate |
A non-negative numeric vector of rate. |
A numeric vector of the random samples.
Other ran_dist:
ran_bern()
,
ran_beta_binom()
,
ran_binom()
,
ran_gamma_pois()
,
ran_gamma_pois_zi()
,
ran_lnorm()
,
ran_neg_binom()
,
ran_norm()
,
ran_pois()
,
ran_pois_zi()
,
ran_skewnorm()
,
ran_student()
ran_gamma(10)
ran_gamma(10)
Gamma-Poisson Random Samples
ran_gamma_pois(n = 1, lambda = 1, theta = 0)
ran_gamma_pois(n = 1, lambda = 1, theta = 0)
n |
A non-negative whole number of the number of random samples to generate. |
lambda |
A non-negative numeric vector of means. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
A numeric vector of the random samples.
Other ran_dist:
ran_bern()
,
ran_beta_binom()
,
ran_binom()
,
ran_gamma()
,
ran_gamma_pois_zi()
,
ran_lnorm()
,
ran_neg_binom()
,
ran_norm()
,
ran_pois()
,
ran_pois_zi()
,
ran_skewnorm()
,
ran_student()
ran_gamma_pois(10, theta = 1)
ran_gamma_pois(10, theta = 1)
Zero-Inflated Gamma-Poisson Random Samples
ran_gamma_pois_zi(n = 1, lambda = 1, theta = 0, prob = 0)
ran_gamma_pois_zi(n = 1, lambda = 1, theta = 0, prob = 0)
n |
A non-negative whole number of the number of random samples to generate. |
lambda |
A non-negative numeric vector of means. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
prob |
A numeric vector of values between 0 and 1 of the probability of success. |
A numeric vector of the random samples.
Other ran_dist:
ran_bern()
,
ran_beta_binom()
,
ran_binom()
,
ran_gamma()
,
ran_gamma_pois()
,
ran_lnorm()
,
ran_neg_binom()
,
ran_norm()
,
ran_pois()
,
ran_pois_zi()
,
ran_skewnorm()
,
ran_student()
ran_gamma_pois_zi(10, lambda = 3, theta = 1, prob = 0.5)
ran_gamma_pois_zi(10, lambda = 3, theta = 1, prob = 0.5)
Log-Normal Random Samples
ran_lnorm(n = 1, meanlog = 0, sdlog = 1)
ran_lnorm(n = 1, meanlog = 0, sdlog = 1)
n |
A non-negative whole number of the number of random samples to generate. |
meanlog |
A numeric vector of the means on the log scale. |
sdlog |
A non-negative numeric vector of the standard deviations on the log scale. |
A numeric vector of the random samples.
Other ran_dist:
ran_bern()
,
ran_beta_binom()
,
ran_binom()
,
ran_gamma()
,
ran_gamma_pois()
,
ran_gamma_pois_zi()
,
ran_neg_binom()
,
ran_norm()
,
ran_pois()
,
ran_pois_zi()
,
ran_skewnorm()
,
ran_student()
ran_lnorm(10)
ran_lnorm(10)
Identical to Gamma-Poisson Random Samples.
ran_neg_binom(n = 1, lambda = 1, theta = 0)
ran_neg_binom(n = 1, lambda = 1, theta = 0)
n |
A non-negative whole number of the number of random samples to generate. |
lambda |
A non-negative numeric vector of means. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
A numeric vector of the random samples.
Other ran_dist:
ran_bern()
,
ran_beta_binom()
,
ran_binom()
,
ran_gamma()
,
ran_gamma_pois()
,
ran_gamma_pois_zi()
,
ran_lnorm()
,
ran_norm()
,
ran_pois()
,
ran_pois_zi()
,
ran_skewnorm()
,
ran_student()
ran_neg_binom(10, theta = 1)
ran_neg_binom(10, theta = 1)
Normal Random Samples
ran_norm(n = 1, mean = 0, sd = 1)
ran_norm(n = 1, mean = 0, sd = 1)
n |
A non-negative whole number of the number of random samples to generate. |
mean |
A numeric vector of the means. |
sd |
A non-negative numeric vector of the standard deviations. |
A numeric vector of the random samples.
Other ran_dist:
ran_bern()
,
ran_beta_binom()
,
ran_binom()
,
ran_gamma()
,
ran_gamma_pois()
,
ran_gamma_pois_zi()
,
ran_lnorm()
,
ran_neg_binom()
,
ran_pois()
,
ran_pois_zi()
,
ran_skewnorm()
,
ran_student()
ran_norm(10)
ran_norm(10)
Poisson Random Samples
ran_pois(n = 1, lambda = 1)
ran_pois(n = 1, lambda = 1)
n |
A non-negative whole number of the number of random samples to generate. |
lambda |
A non-negative numeric vector of means. |
A numeric vector of the random samples.
Other ran_dist:
ran_bern()
,
ran_beta_binom()
,
ran_binom()
,
ran_gamma()
,
ran_gamma_pois()
,
ran_gamma_pois_zi()
,
ran_lnorm()
,
ran_neg_binom()
,
ran_norm()
,
ran_pois_zi()
,
ran_skewnorm()
,
ran_student()
ran_pois(10)
ran_pois(10)
Zero-Inflated Poisson Random Samples
ran_pois_zi(n = 1, lambda = 1, prob = 0)
ran_pois_zi(n = 1, lambda = 1, prob = 0)
n |
A non-negative whole number of the number of random samples to generate. |
lambda |
A non-negative numeric vector of means. |
prob |
A numeric vector of values between 0 and 1 of the probability of success. |
A numeric vector of the random samples.
Other ran_dist:
ran_bern()
,
ran_beta_binom()
,
ran_binom()
,
ran_gamma()
,
ran_gamma_pois()
,
ran_gamma_pois_zi()
,
ran_lnorm()
,
ran_neg_binom()
,
ran_norm()
,
ran_pois()
,
ran_skewnorm()
,
ran_student()
ran_pois_zi(10, prob = 0.5)
ran_pois_zi(10, prob = 0.5)
Skew Normal Random Samples
ran_skewnorm(n = 1, mean = 0, sd = 1, shape = 0)
ran_skewnorm(n = 1, mean = 0, sd = 1, shape = 0)
n |
A non-negative whole number of the number of random samples to generate. |
mean |
A numeric vector of the means. |
sd |
A non-negative numeric vector of the standard deviations. |
shape |
A numeric vector of shape. |
A numeric vector of the random samples.
Other ran_dist:
ran_bern()
,
ran_beta_binom()
,
ran_binom()
,
ran_gamma()
,
ran_gamma_pois()
,
ran_gamma_pois_zi()
,
ran_lnorm()
,
ran_neg_binom()
,
ran_norm()
,
ran_pois()
,
ran_pois_zi()
,
ran_student()
ran_skewnorm(10, shape = -1) ran_skewnorm(10, shape = 0) ran_skewnorm(10, shape = 1)
ran_skewnorm(10, shape = -1) ran_skewnorm(10, shape = 0) ran_skewnorm(10, shape = 1)
Student's t Random Samples
ran_student(n = 1, mean = 0, sd = 1, theta = 0)
ran_student(n = 1, mean = 0, sd = 1, theta = 0)
n |
A non-negative whole number of the number of random samples to generate. |
mean |
A numeric vector of the means. |
sd |
A non-negative numeric vector of the standard deviations. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
A numeric vector of the random samples.
Other ran_dist:
ran_bern()
,
ran_beta_binom()
,
ran_binom()
,
ran_gamma()
,
ran_gamma_pois()
,
ran_gamma_pois_zi()
,
ran_lnorm()
,
ran_neg_binom()
,
ran_norm()
,
ran_pois()
,
ran_pois_zi()
,
ran_skewnorm()
ran_student(10, theta = 1 / 2)
ran_student(10, theta = 1 / 2)
Bernoulli Residuals
res_bern(x, prob = 0.5, type = "dev", simulate = FALSE)
res_bern(x, prob = 0.5, type = "dev", simulate = FALSE)
x |
A vector of 0s and 1s. |
prob |
A numeric vector of values between 0 and 1 of the probability of success. |
type |
A string of the residual type. 'raw' for raw residuals 'dev' for deviance residuals and 'data' for the data. |
simulate |
A flag specifying whether to simulate residuals. |
An numeric vector of the corresponding residuals.
Other res_dist:
res_beta_binom()
,
res_binom()
,
res_gamma()
,
res_gamma_pois()
,
res_gamma_pois_zi()
,
res_lnorm()
,
res_neg_binom()
,
res_norm()
,
res_pois()
,
res_pois_zi()
,
res_skewnorm()
,
res_student()
res_bern(c(TRUE, FALSE), 0.7)
res_bern(c(TRUE, FALSE), 0.7)
This parameterization of the beta-binomial distribution uses an expected
probability parameter, prob
, and a dispersion parameter, theta
. The
parameters of the underlying beta mixture are alpha = (2 * prob) / theta
and beta = (2 * (1 - prob)) / theta
. This parameterization of theta
is
unconventional, but has useful properties when modelling. When theta = 0
,
the beta-binomial reverts to the binomial distribution. When theta = 1
and
prob = 0.5
, the parameters of the beta distribution become alpha = 1
and
beta = 1
, which correspond to a uniform distribution for the beta-binomial
probability parameter.
res_beta_binom( x, size = 1, prob = 0.5, theta = 0, type = "dev", simulate = FALSE )
res_beta_binom( x, size = 1, prob = 0.5, theta = 0, type = "dev", simulate = FALSE )
x |
A non-negative whole numeric vector of values. |
size |
A non-negative whole numeric vector of the number of trials. |
prob |
A numeric vector of values between 0 and 1 of the probability of success. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
type |
A string of the residual type. 'raw' for raw residuals 'dev' for deviance residuals and 'data' for the data. |
simulate |
A flag specifying whether to simulate residuals. |
An numeric vector of the corresponding residuals.
Other res_dist:
res_bern()
,
res_binom()
,
res_gamma()
,
res_gamma_pois()
,
res_gamma_pois_zi()
,
res_lnorm()
,
res_neg_binom()
,
res_norm()
,
res_pois()
,
res_pois_zi()
,
res_skewnorm()
,
res_student()
res_beta_binom(c(0, 1, 2), 4, 0.5, 0.1)
res_beta_binom(c(0, 1, 2), 4, 0.5, 0.1)
Binomial Residuals
res_binom(x, size = 1, prob = 0.5, type = "dev", simulate = FALSE)
res_binom(x, size = 1, prob = 0.5, type = "dev", simulate = FALSE)
x |
A non-negative whole numeric vector of values. |
size |
A non-negative whole numeric vector of the number of trials. |
prob |
A numeric vector of values between 0 and 1 of the probability of success. |
type |
A string of the residual type. 'raw' for raw residuals 'dev' for deviance residuals and 'data' for the data. |
simulate |
A flag specifying whether to simulate residuals. |
An numeric vector of the corresponding residuals.
Other res_dist:
res_bern()
,
res_beta_binom()
,
res_gamma()
,
res_gamma_pois()
,
res_gamma_pois_zi()
,
res_lnorm()
,
res_neg_binom()
,
res_norm()
,
res_pois()
,
res_pois_zi()
,
res_skewnorm()
,
res_student()
res_binom(c(0, 1, 2), 2, 0.3)
res_binom(c(0, 1, 2), 2, 0.3)
Gamma Residuals
res_gamma(x, shape = 1, rate = 1, type = "dev", simulate = FALSE)
res_gamma(x, shape = 1, rate = 1, type = "dev", simulate = FALSE)
x |
A numeric vector of values. |
shape |
A non-negative numeric vector of shape. |
rate |
A non-negative numeric vector of rate. |
type |
A string of the residual type. 'raw' for raw residuals 'dev' for deviance residuals and 'data' for the data. |
simulate |
A flag specifying whether to simulate residuals. |
An numeric vector of the corresponding residuals.
Other res_dist:
res_bern()
,
res_beta_binom()
,
res_binom()
,
res_gamma_pois()
,
res_gamma_pois_zi()
,
res_lnorm()
,
res_neg_binom()
,
res_norm()
,
res_pois()
,
res_pois_zi()
,
res_skewnorm()
,
res_student()
res_gamma(c(0, 1, 2), 1, 2)
res_gamma(c(0, 1, 2), 1, 2)
Gamma-Poisson Residuals
res_gamma_pois(x, lambda = 1, theta = 0, type = "dev", simulate = FALSE)
res_gamma_pois(x, lambda = 1, theta = 0, type = "dev", simulate = FALSE)
x |
A non-negative whole numeric vector of values. |
lambda |
A non-negative numeric vector of means. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
type |
A string of the residual type. 'raw' for raw residuals 'dev' for deviance residuals and 'data' for the data. |
simulate |
A flag specifying whether to simulate residuals. |
An numeric vector of the corresponding residuals.
Other res_dist:
res_bern()
,
res_beta_binom()
,
res_binom()
,
res_gamma()
,
res_gamma_pois_zi()
,
res_lnorm()
,
res_neg_binom()
,
res_norm()
,
res_pois()
,
res_pois_zi()
,
res_skewnorm()
,
res_student()
res_gamma_pois(c(0, 1, 2), 1, 1)
res_gamma_pois(c(0, 1, 2), 1, 1)
Zero-Inflated Gamma-Poisson Residuals
res_gamma_pois_zi( x, lambda = 1, theta = 0, prob = 0, type = "dev", simulate = FALSE )
res_gamma_pois_zi( x, lambda = 1, theta = 0, prob = 0, type = "dev", simulate = FALSE )
x |
A non-negative whole numeric vector of values. |
lambda |
A non-negative numeric vector of means. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
prob |
A numeric vector of values between 0 and 1 of the probability of zero-inflation. |
type |
A string of the residual type. 'raw' for raw residuals 'dev' for deviance residuals and 'data' for the data. |
simulate |
A flag specifying whether to simulate residuals. |
An numeric vector of the corresponding residuals.
Other res_dist:
res_bern()
,
res_beta_binom()
,
res_binom()
,
res_gamma()
,
res_gamma_pois()
,
res_lnorm()
,
res_neg_binom()
,
res_norm()
,
res_pois()
,
res_pois_zi()
,
res_skewnorm()
,
res_student()
res_gamma_pois_zi(c(0, 1, 2), 1, 1, 0.5)
res_gamma_pois_zi(c(0, 1, 2), 1, 1, 0.5)
Log-Normal Residuals
res_lnorm(x, meanlog = 0, sdlog = 1, type = "dev", simulate = FALSE)
res_lnorm(x, meanlog = 0, sdlog = 1, type = "dev", simulate = FALSE)
x |
A numeric vector of values. |
meanlog |
A numeric vector of the means on the log scale. |
sdlog |
A non-negative numeric vector of the standard deviations on the log scale. |
type |
A string of the residual type. 'raw' for raw residuals 'dev' for deviance residuals and 'data' for the data. |
simulate |
A flag specifying whether to simulate residuals. |
An numeric vector of the corresponding residuals.
Other res_dist:
res_bern()
,
res_beta_binom()
,
res_binom()
,
res_gamma()
,
res_gamma_pois()
,
res_gamma_pois_zi()
,
res_neg_binom()
,
res_norm()
,
res_pois()
,
res_pois_zi()
,
res_skewnorm()
,
res_student()
res_lnorm(10)
res_lnorm(10)
Negative Binomial Residuals
res_neg_binom(x, lambda = 1, theta = 0, type = "dev", simulate = FALSE)
res_neg_binom(x, lambda = 1, theta = 0, type = "dev", simulate = FALSE)
x |
A non-negative whole numeric vector of values. |
lambda |
A non-negative numeric vector of means. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
type |
A string of the residual type. 'raw' for raw residuals 'dev' for deviance residuals and 'data' for the data. |
simulate |
A flag specifying whether to simulate residuals. |
An numeric vector of the corresponding residuals.
Other res_dist:
res_bern()
,
res_beta_binom()
,
res_binom()
,
res_gamma()
,
res_gamma_pois()
,
res_gamma_pois_zi()
,
res_lnorm()
,
res_norm()
,
res_pois()
,
res_pois_zi()
,
res_skewnorm()
,
res_student()
res_neg_binom(c(0, 1, 5), 2, 3)
res_neg_binom(c(0, 1, 5), 2, 3)
Normal Residuals
res_norm(x, mean = 0, sd = 1, type = "dev", simulate = FALSE)
res_norm(x, mean = 0, sd = 1, type = "dev", simulate = FALSE)
x |
A numeric vector of values. |
mean |
A numeric vector of the means. |
sd |
A non-negative numeric vector of the standard deviations. |
type |
A string of the residual type. 'raw' for raw residuals 'dev' for deviance residuals and 'data' for the data. |
simulate |
A flag specifying whether to simulate residuals. |
An numeric vector of the corresponding residuals.
Other res_dist:
res_bern()
,
res_beta_binom()
,
res_binom()
,
res_gamma()
,
res_gamma_pois()
,
res_gamma_pois_zi()
,
res_lnorm()
,
res_neg_binom()
,
res_pois()
,
res_pois_zi()
,
res_skewnorm()
,
res_student()
res_norm(c(-2:2))
res_norm(c(-2:2))
Poisson Residuals
res_pois(x, lambda = 1, type = "dev", simulate = FALSE)
res_pois(x, lambda = 1, type = "dev", simulate = FALSE)
x |
A non-negative whole numeric vector of values. |
lambda |
A non-negative numeric vector of means. |
type |
A string of the residual type. 'raw' for raw residuals 'dev' for deviance residuals and 'data' for the data. |
simulate |
A flag specifying whether to simulate residuals. |
An numeric vector of the corresponding residuals.
Other res_dist:
res_bern()
,
res_beta_binom()
,
res_binom()
,
res_gamma()
,
res_gamma_pois()
,
res_gamma_pois_zi()
,
res_lnorm()
,
res_neg_binom()
,
res_norm()
,
res_pois_zi()
,
res_skewnorm()
,
res_student()
res_pois(c(1, 3, 4), 3)
res_pois(c(1, 3, 4), 3)
Zero-Inflated Poisson Residuals
res_pois_zi(x, lambda = 1, prob = 0, type = "dev", simulate = FALSE)
res_pois_zi(x, lambda = 1, prob = 0, type = "dev", simulate = FALSE)
x |
A non-negative whole numeric vector of values. |
lambda |
A non-negative numeric vector of means. |
prob |
A numeric vector of values between 0 and 1 of the probability of zero-inflation. |
type |
A string of the residual type. 'raw' for raw residuals 'dev' for deviance residuals and 'data' for the data. |
simulate |
A flag specifying whether to simulate residuals. |
An numeric vector of the corresponding residuals.
Other res_dist:
res_bern()
,
res_beta_binom()
,
res_binom()
,
res_gamma()
,
res_gamma_pois()
,
res_gamma_pois_zi()
,
res_lnorm()
,
res_neg_binom()
,
res_norm()
,
res_pois()
,
res_skewnorm()
,
res_student()
res_pois_zi(c(1, 3, 4), 6, 0.5, type = "raw")
res_pois_zi(c(1, 3, 4), 6, 0.5, type = "raw")
Skew Normal Residuals
res_skewnorm(x, mean = 0, sd = 1, shape = 0, type = "dev", simulate = FALSE)
res_skewnorm(x, mean = 0, sd = 1, shape = 0, type = "dev", simulate = FALSE)
x |
A numeric vector of values. |
mean |
A numeric vector of the means. |
sd |
A non-negative numeric vector of the standard deviations. |
shape |
A numeric vector of shape. |
type |
A string of the residual type. 'raw' for raw residuals 'dev' for deviance residuals and 'data' for the data. |
simulate |
A flag specifying whether to simulate residuals. |
An numeric vector of the corresponding residuals.
Other res_dist:
res_bern()
,
res_beta_binom()
,
res_binom()
,
res_gamma()
,
res_gamma_pois()
,
res_gamma_pois_zi()
,
res_lnorm()
,
res_neg_binom()
,
res_norm()
,
res_pois()
,
res_pois_zi()
,
res_student()
res_skewnorm(c(-2:2))
res_skewnorm(c(-2:2))
Student's t Residuals
res_student(x, mean = 0, sd = 1, theta = 0, type = "dev", simulate = FALSE)
res_student(x, mean = 0, sd = 1, theta = 0, type = "dev", simulate = FALSE)
x |
A non-negative whole numeric vector of values. |
mean |
A numeric vector of the means. |
sd |
A non-negative numeric vector of the standard deviations. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
type |
A string of the residual type. 'raw' for raw residuals 'dev' for deviance residuals and 'data' for the data. |
simulate |
A flag specifying whether to simulate residuals. |
An numeric vector of the corresponding residuals.
Other res_dist:
res_bern()
,
res_beta_binom()
,
res_binom()
,
res_gamma()
,
res_gamma_pois()
,
res_gamma_pois_zi()
,
res_lnorm()
,
res_neg_binom()
,
res_norm()
,
res_pois()
,
res_pois_zi()
,
res_skewnorm()
res_student(c(1, 3.5, 4), mean = 6, sd = 0.5, theta = 1 / 3, type = "raw")
res_student(c(1, 3.5, 4), mean = 6, sd = 0.5, theta = 1 / 3, type = "raw")
Expands (sd_mult > 1
) or reduces (sd_mult < 1
) the standard deviation
of the Beta distribution. The Beta distribution has a maximum variance of
mean(x) * (1 - mean(x)
, where mean(x) = alpha / (alpha + beta)
. If the
inputs produce a desired variance that is greater than the maximum possible
variance, or provides alpha and/or beta parameters that are < 1
and thus
push more probability weight towards extreme probability values, this
function returns alpha = 1
and beta = 1
(the uniform distribution).
sens_beta(alpha, beta, sd_mult = 2)
sens_beta(alpha, beta, sd_mult = 2)
alpha |
The first shape parameter of the Beta distribution. |
beta |
The second shape parameter of the Beta distribution. |
sd_mult |
A non-negative multiplier on the standard deviation of the distribution. |
A named list of the adjusted distribution's parameters.
Other sens_dist:
sens_exp()
,
sens_gamma()
,
sens_gamma_pois()
,
sens_gamma_pois_zi()
,
sens_lnorm()
,
sens_neg_binom()
,
sens_norm()
,
sens_pois()
,
sens_skewnorm()
,
sens_student()
sens_beta(10, 10, 2) sens_beta(10, 10, 0.8)
sens_beta(10, 10, 2) sens_beta(10, 10, 0.8)
Expands (sd_mult > 1
) or reduces (sd_mult < 1
) the standard deviation
of the exponential distribution. Due to the parameterization of this
distribution, adjusting the standard deviation necessarily changes the mean
value.
sens_exp(rate, sd_mult = 2)
sens_exp(rate, sd_mult = 2)
rate |
A non-negative numeric vector of rate. |
sd_mult |
A non-negative multiplier on the standard deviation of the distribution. |
A named list of the adjusted distribution's parameters.
Other sens_dist:
sens_beta()
,
sens_gamma()
,
sens_gamma_pois()
,
sens_gamma_pois_zi()
,
sens_lnorm()
,
sens_neg_binom()
,
sens_norm()
,
sens_pois()
,
sens_skewnorm()
,
sens_student()
sens_exp(10, 2) sens_exp(10, 0.8)
sens_exp(10, 2) sens_exp(10, 0.8)
Expands (sd_mult > 1
) or reduces (sd_mult < 1
) the standard deviation
of the Gamma distribution.
sens_gamma(shape, rate, sd_mult = 2)
sens_gamma(shape, rate, sd_mult = 2)
shape |
A non-negative numeric vector of shape. |
rate |
A non-negative numeric vector of rate. |
sd_mult |
A non-negative multiplier on the standard deviation of the distribution. |
A named list of the adjusted distribution's parameters.
Other sens_dist:
sens_beta()
,
sens_exp()
,
sens_gamma_pois()
,
sens_gamma_pois_zi()
,
sens_lnorm()
,
sens_neg_binom()
,
sens_norm()
,
sens_pois()
,
sens_skewnorm()
,
sens_student()
sens_gamma(10, 2, 2) sens_gamma(10, 2, 0.2)
sens_gamma(10, 2, 2) sens_gamma(10, 2, 0.2)
Expands (sd_mult > 1
) the standard deviation of the Negative Binomial
distribution. This function does not currently have the option to reduce the
standard deviation.
sens_gamma_pois(lambda, theta, sd_mult = 2)
sens_gamma_pois(lambda, theta, sd_mult = 2)
lambda |
A non-negative numeric vector of means. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
sd_mult |
A non-negative multiplier on the standard deviation of the distribution. |
A named list of the adjusted distribution's parameters.
Other sens_dist:
sens_beta()
,
sens_exp()
,
sens_gamma()
,
sens_gamma_pois_zi()
,
sens_lnorm()
,
sens_neg_binom()
,
sens_norm()
,
sens_pois()
,
sens_skewnorm()
,
sens_student()
sens_gamma_pois(10, 0.1, 2)
sens_gamma_pois(10, 0.1, 2)
Expands (sd_mult > 1
) or reduces (sd_mult < 1
) the standard deviation
of the Zero-Inflated Gamma-Poisson distribution.
sens_gamma_pois_zi(lambda, theta, prob, sd_mult = 2)
sens_gamma_pois_zi(lambda, theta, prob, sd_mult = 2)
lambda |
A non-negative numeric vector of means. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
prob |
A numeric vector of values between 0 and 1 of the probability of success. |
sd_mult |
A non-negative multiplier on the standard deviation of the distribution. |
A named list of the adjusted distribution's parameters.
Other sens_dist:
sens_beta()
,
sens_exp()
,
sens_gamma()
,
sens_gamma_pois()
,
sens_lnorm()
,
sens_neg_binom()
,
sens_norm()
,
sens_pois()
,
sens_skewnorm()
,
sens_student()
sens_gamma_pois_zi(10, 0.1, 0.3, 2)
sens_gamma_pois_zi(10, 0.1, 0.3, 2)
Expands (sd_mult > 1
) or reduces (sd_mult < 1
) the standard deviation
of the Log-Normal distribution. With high values of sdlog
(i.e., > 9
),
and sd_mult > 1
, the mean of the adjusted distribution can be expected to
have a mean value that is very different from the original mean, however,
the proportional difference in these values should not be very different.
sens_lnorm(meanlog, sdlog, sd_mult = 2)
sens_lnorm(meanlog, sdlog, sd_mult = 2)
meanlog |
A numeric vector of the means on the log scale. |
sdlog |
A non-negative numeric vector of the standard deviations on the log scale. |
sd_mult |
A non-negative multiplier on the standard deviation of the distribution. |
A named list of the adjusted distribution's parameters.
Other sens_dist:
sens_beta()
,
sens_exp()
,
sens_gamma()
,
sens_gamma_pois()
,
sens_gamma_pois_zi()
,
sens_neg_binom()
,
sens_norm()
,
sens_pois()
,
sens_skewnorm()
,
sens_student()
sens_lnorm(0, 1, 2) sens_lnorm(0, 1, 0.8)
sens_lnorm(0, 1, 2) sens_lnorm(0, 1, 0.8)
Expands (sd_mult > 1
) the standard deviation of the Negative Binomial
distribution. This function does not currently have the option to reduce the
standard deviation.
sens_neg_binom(lambda, theta, sd_mult = 2)
sens_neg_binom(lambda, theta, sd_mult = 2)
lambda |
A non-negative numeric vector of means. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
sd_mult |
A non-negative multiplier on the standard deviation of the distribution. |
A named list of the adjusted distribution's parameters.
Other sens_dist:
sens_beta()
,
sens_exp()
,
sens_gamma()
,
sens_gamma_pois()
,
sens_gamma_pois_zi()
,
sens_lnorm()
,
sens_norm()
,
sens_pois()
,
sens_skewnorm()
,
sens_student()
sens_neg_binom(10, 0.1, 2)
sens_neg_binom(10, 0.1, 2)
Expands (sd_mult > 1
) or reduces (sd_mult < 1
) the standard deviation
of the Normal distribution without changing the mean.
sens_norm(mean, sd, sd_mult = 2)
sens_norm(mean, sd, sd_mult = 2)
mean |
A numeric vector of the means. |
sd |
A non-negative numeric vector of the standard deviations. |
sd_mult |
A non-negative multiplier on the standard deviation of the distribution. |
A named list of the adjusted distribution's parameters.
Other sens_dist:
sens_beta()
,
sens_exp()
,
sens_gamma()
,
sens_gamma_pois()
,
sens_gamma_pois_zi()
,
sens_lnorm()
,
sens_neg_binom()
,
sens_pois()
,
sens_skewnorm()
,
sens_student()
sens_norm(10, 3, 2) sens_norm(10, 3, 0.8)
sens_norm(10, 3, 2) sens_norm(10, 3, 0.8)
Expands (sd_mult > 1
) or reduces (sd_mult < 1
) the standard deviation
of the Poisson distribution. Due to the parameterization of this
distribution, adjusting the standard deviation necessarily changes the mean
value.
sens_pois(lambda, sd_mult = 2)
sens_pois(lambda, sd_mult = 2)
lambda |
A non-negative numeric vector of means. |
sd_mult |
A non-negative multiplier on the standard deviation of the distribution. |
A named list of the adjusted distribution's parameters.
Other sens_dist:
sens_beta()
,
sens_exp()
,
sens_gamma()
,
sens_gamma_pois()
,
sens_gamma_pois_zi()
,
sens_lnorm()
,
sens_neg_binom()
,
sens_norm()
,
sens_skewnorm()
,
sens_student()
sens_pois(10, 2) sens_pois(10, 0.8)
sens_pois(10, 2) sens_pois(10, 0.8)
Expands (sd_mult > 1
) or reduces (sd_mult < 1
) the standard deviation
of the Skew Normal distribution without changing the mean.
sens_skewnorm(mean, sd, shape, sd_mult = 2)
sens_skewnorm(mean, sd, shape, sd_mult = 2)
mean |
A numeric vector of the means. |
sd |
A non-negative numeric vector of the standard deviations. |
shape |
A non-negative numeric vector of shape. |
sd_mult |
A non-negative multiplier on the standard deviation of the distribution. |
A named list of the adjusted distribution's parameters.
Other sens_dist:
sens_beta()
,
sens_exp()
,
sens_gamma()
,
sens_gamma_pois()
,
sens_gamma_pois_zi()
,
sens_lnorm()
,
sens_neg_binom()
,
sens_norm()
,
sens_pois()
,
sens_student()
sens_skewnorm(10, 3, -1, 2) sens_skewnorm(10, 3, 3, 0.8)
sens_skewnorm(10, 3, -1, 2) sens_skewnorm(10, 3, 3, 0.8)
Expands (sd_mult > 1
) or reduces (sd_mult < 1
) the standard deviation
of the Student's t distribution. Because the variance of this distribution
is not defined for every degree of freedom, the adjustment to the standard
deviation is approximate, and the mean of the adjusted distribution can
be expected to have shifted.
sens_student(mean, sd, theta, sd_mult = 2)
sens_student(mean, sd, theta, sd_mult = 2)
mean |
A numeric vector of the means. |
sd |
A non-negative numeric vector of the standard deviations. |
theta |
A non-negative numeric vector of the dispersion for the mixture models (student, gamma-Poisson and beta-binomial). |
sd_mult |
A non-negative multiplier on the standard deviation of the distribution. |
A named list of the adjusted distribution's parameters.
Other sens_dist:
sens_beta()
,
sens_exp()
,
sens_gamma()
,
sens_gamma_pois()
,
sens_gamma_pois_zi()
,
sens_lnorm()
,
sens_neg_binom()
,
sens_norm()
,
sens_pois()
,
sens_skewnorm()
sens_student(10, 3, 0.1, 2) sens_student(10, 3, 0.1, 0.8)
sens_student(10, 3, 0.1, 2) sens_student(10, 3, 0.1, 0.8)
Calculates the surprisal (in bits) that a cumulative distribution function probability is at least that extreme.
sextreme(x, directional = FALSE)
sextreme(x, directional = FALSE)
x |
A numeric vector of values between 0 and 1. |
directional |
A flag specifying whether probabilities less than 0.5 should be returned as negative values. |
A numeric vector of surprisal values.
Other residuals:
pextreme()
sextreme(seq(0.1, 0.9, by = 0.1)) sextreme(seq(0.1, 0.9, by = 0.1), directional = TRUE)
sextreme(seq(0.1, 0.9, by = 0.1)) sextreme(seq(0.1, 0.9, by = 0.1), directional = TRUE)
Skewness
skewness(x, na_rm = FALSE)
skewness(x, na_rm = FALSE)
x |
A numeric object of MCMC values. |
na_rm |
A flag specifying whether to remove missing values. |
A number.
Other summary:
kurtosis()
,
lower()
,
pvalue()
,
pzeros()
,
svalue()
,
upper()
,
variance()
,
xtr_mean()
,
xtr_median()
,
xtr_sd()
,
zeros()
,
zscore()
skewness(1:10)
skewness(1:10)
Step
step(x)
step(x)
x |
A numeric atomic object. |
A logical value.
Other translations:
exp10()
,
exp2()
,
fabs()
,
ilog()
,
ilog10()
,
ilog2()
,
ilogit()
,
inv_logit()
,
invlogit()
,
log10<-()
,
log2<-()
,
log<-()
,
logit()
,
logit<-()
,
phi()
,
pow()
step(1)
step(1)
The surprisal value (Greenland 2019) is the pvalue expressed in terms of how many consecutive heads would have to be thrown on a fair coin in a single attempt to achieve the same probability.
svalue(x, threshold = 0, na_rm = FALSE)
svalue(x, threshold = 0, na_rm = FALSE)
x |
A numeric object of MCMC values. |
threshold |
A number of the threshold value. |
na_rm |
A flag specifying whether to remove missing values. |
A non-negative number.
Greenland, S. 2019. Valid P -Values Behave Exactly as They Should: Some Misleading Criticisms of P -Values and Their Resolution With S -Values. The American Statistician 73(sup1): 106–114. doi:10.1080/00031305.2018.1529625.
Other summary:
kurtosis()
,
lower()
,
pvalue()
,
pzeros()
,
skewness()
,
upper()
,
variance()
,
xtr_mean()
,
xtr_median()
,
xtr_sd()
,
zeros()
,
zscore()
svalue(as.numeric(0:100))
svalue(as.numeric(0:100))
Calculates the quantile-based upper credible limit.
upper(x, conf_level = 0.95, na_rm = FALSE)
upper(x, conf_level = 0.95, na_rm = FALSE)
x |
A numeric vector of MCMC values. |
conf_level |
A numeric scalar between 0 and 1 specifying the confidence level. |
na_rm |
A flag specifying whether to remove missing values. |
By default it returns the 95% credible limit which corresponds to the 97.5% quantile.
A number.
Other summary:
kurtosis()
,
lower()
,
pvalue()
,
pzeros()
,
skewness()
,
svalue()
,
variance()
,
xtr_mean()
,
xtr_median()
,
xtr_sd()
,
zeros()
,
zscore()
upper(as.numeric(0:100))
upper(as.numeric(0:100))
Variance
variance(x, na_rm = FALSE)
variance(x, na_rm = FALSE)
x |
A numeric object of MCMC values. |
na_rm |
A flag specifying whether to remove missing values. |
A number.
Other summary:
kurtosis()
,
lower()
,
pvalue()
,
pzeros()
,
skewness()
,
svalue()
,
upper()
,
xtr_mean()
,
xtr_median()
,
xtr_sd()
,
zeros()
,
zscore()
variance(1:10)
variance(1:10)
Mean
xtr_mean(x, na_rm = FALSE)
xtr_mean(x, na_rm = FALSE)
x |
A numeric object of MCMC values. |
na_rm |
A flag specifying whether to remove missing values. |
A number.
Other summary:
kurtosis()
,
lower()
,
pvalue()
,
pzeros()
,
skewness()
,
svalue()
,
upper()
,
variance()
,
xtr_median()
,
xtr_sd()
,
zeros()
,
zscore()
xtr_mean(1:10)
xtr_mean(1:10)
Median
xtr_median(x, na_rm = FALSE)
xtr_median(x, na_rm = FALSE)
x |
A numeric object of MCMC values. |
na_rm |
A flag specifying whether to remove missing values. |
A number.
Other summary:
kurtosis()
,
lower()
,
pvalue()
,
pzeros()
,
skewness()
,
svalue()
,
upper()
,
variance()
,
xtr_mean()
,
xtr_sd()
,
zeros()
,
zscore()
xtr_mean(1:10)
xtr_mean(1:10)
Standard Deviation
xtr_sd(x, na_rm = FALSE)
xtr_sd(x, na_rm = FALSE)
x |
A numeric object of MCMC values. |
na_rm |
A flag specifying whether to remove missing values. |
A number.
Other summary:
kurtosis()
,
lower()
,
pvalue()
,
pzeros()
,
skewness()
,
svalue()
,
upper()
,
variance()
,
xtr_mean()
,
xtr_median()
,
zeros()
,
zscore()
xtr_sd(1:10)
xtr_sd(1:10)
The number of zeros in an numeric object.
zeros(x, na_rm = FALSE)
zeros(x, na_rm = FALSE)
x |
A numeric object of MCMC values. |
na_rm |
A flag specifying whether to remove missing values. |
A non-negative integer.
Other summary:
kurtosis()
,
lower()
,
pvalue()
,
pzeros()
,
skewness()
,
svalue()
,
upper()
,
variance()
,
xtr_mean()
,
xtr_median()
,
xtr_sd()
,
zscore()
zeros(c(0:2))
zeros(c(0:2))
The Bayesian z-score is here defined as the number of standard deviations from the mean estimate to zero.
zscore(x, na_rm = FALSE)
zscore(x, na_rm = FALSE)
x |
A numeric object of MCMC values. |
na_rm |
A flag specifying whether to remove missing values. |
A number.
Other summary:
kurtosis()
,
lower()
,
pvalue()
,
pzeros()
,
skewness()
,
svalue()
,
upper()
,
variance()
,
xtr_mean()
,
xtr_median()
,
xtr_sd()
,
zeros()
zscore(as.numeric(0:100))
zscore(as.numeric(0:100))