pph: Calculates the posterior probability of hypotheses for one...

Description Usage Arguments Details Value See Also Examples

View source: R/pph.R

Description

The function takes a single effect size and its standard error and calculates the posterior probability of each hypothesis (H<: the effect size is less than 0, H0: the effect size is zero, or H>: the effect size is greater than zero).

Usage

1
2
3
pph(beta, se.beta, beta0 = 0, se0 = NULL, ci = 99, se.mult = 1,
  H0 = c(0, 0), H.priors = rep(1/3, 3), scale = FALSE, adjust = FALSE,
  epsilon = 1e-06, adj.factor = 1e-04)

Arguments

beta

Effect size.

se.beta

Standard error for the effect.

beta0

A prior value for the effect size. Default is zero.

se0

A prior standard error for the effect size. Default is NULL and is calculated automatically.

ci

Is used to calculate the prior standard error if se0 = NULL. The default value of 99 calculates the prior standard error so that the 99 largest (furthest from zero) confidence interval of the data distribution.

se.mult

Standard error multiplier used to increase or decrease the prior SE and used in conjunction with ci when se0 = NULL.

H0

A vector of length two that defines the null hypothesis. If the values are identical (e.g. H0 = c(0,0)) a point null is used, otherwise the null is defined as the range between the lower and upper value.

H.priors

Prior hypothesis probabilities; default is an equal probability of 1/3, and they are specified in the following order: H<0, H=0, H>0.

scale

Logical. Whether to scale the effect size by its standard error. Standardising has no effect on the calculations but standardised effect sizes may be easier to compare in a forest plot.

adjust

Logical. Whether to adjust very small posterior hypothesis probabilities. Adjusting prevents a single study from having too much influence on the results when combining multiple studies. For example, if the probability for a hypothesis from one study is zero, then additional studies cannot alter this probability (multiplying anything by zero is still zero).

epsilon

A small value that a posterior hypothesis probability must fall below before an adjustment is made. Ignored if adjust = FALSE.

adj.factor

A small number added to each posterior hypothesis probability if adjust = TRUE and one of the posterior hypothesis probabilities is less than epsilon. The PPHs are then re-scaled to sum to one.

Details

Effect sizes could be a mean difference between groups, regression slope, odds ratio, or other values provided by statistical models. The standard errors represent the uncertainty in the effect size and are provided by most statistical software.

Two types of priors need to be specified. The first is the prior for the effect size, which is given by a mean (usually zero) and standard error, which can be specified by the user or calculated automatically. Second, prior probabilities for each hypothesis need to be provided, and an equal probability of 1/3 is used by default.

The null hypothesis (usually effect size = 0) can be specified as either a point null or as a range. A point null tests if the effect size is exactly zero while the range null tests if the effect size close enough to zero for practical purposes. 'Close enough' is defined by the user as a range on either size of zero.

To combine multiple effect sizes use the ev.combo function.

Value

Object of class pph which contains the posterior hypothesis probabilities and other calculated values.

See Also

plot.PPH, ev.combo

Examples

1
2
3
4
5
# library(labstats) # need to install from CRAN
# plot(time.immob ~ dose, data=fluoxetine) 
# summary(lm(time.immob ~ dose, data=fluoxetine))
x <- pph(beta=-0.25200, se.beta=0.09913) # dose effect from above output
x

stanlazic/BayesCombo documentation built on May 30, 2019, 9:41 a.m.