Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

distr

Specify a general marginal distribution


Description

distr() is used within the function add_integration() to specify marginal distributions for the covariates, via a corresponding inverse CDF. It is also used in predict.stan_nma() to specify a distribution for the baseline response (intercept) when predicting absolute outcomes.

Usage

distr(qfun, ...)

Arguments

qfun

an inverse CDF, either as a function name or a string

...

parameters of the distribution as arguments to qfun, these will be quoted and evaluated later in the context of the aggregate data sources

Details

The function qfun should have a formal argument called p. This restriction serves as a crude check for inverse CDFs (e.g. an error will be given if dnorm is used instead of qnorm). If a user-written CDF is supplied, it must have an argument p which takes a vector of probabilities.

Value

An object of class distr.

See Also

add_integration() where distr() is used to specify marginal distributions for covariates to integrate over, and predict.stan_nma() where distr() is used to specify a distribution on the baseline response.

Examples

## Specifying marginal distributions for integration

df <- data.frame(x1_mean = 2, x1_sd = 0.5, x2 = 0.8)

# Distribution parameters are evaluated in the context of the data frame
add_integration(df,
                x1 = distr(qnorm, mean = x1_mean, sd = x1_sd),
                x2 = distr(qbern, prob = x2),
                cor = diag(2))

multinma

Bayesian Network Meta-Analysis of Individual and Aggregate Data

v0.3.0
GPL-3
Authors
David M. Phillippo [aut, cre] (<https://orcid.org/0000-0003-2672-7841>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.