PredPValue: Posterior predictive p-value

Description Usage Arguments Details Value References Examples

Description

Computes de probability Pr(predicted_i <= observed_i | observed).

Usage

1
PredPValue(..., cutoff = c(0.1, 0.9), decreasing = FALSE, rnd = 3)

Arguments

...

objects of class inla with computed fitted marginals.

cutoff

vector with lower and upper values to define the tails of the p-values cumulative distribution. Default: c(0.1, 0.9).

decreasing

logical. If FALSE (default), models are displayed in increasing order, according to the proportion of values in both tails (the first model has the best fit).

rnd

integer indicating the number of decimal places to be used.

Details

control.predictor = list(link = 1, compute = TRUE) must be used within inla function.

Value

list. The first element contains the proportion of p-values in the lower and upper tails. The second element contains the p-values.

References

Blangiardo, Marta, and Michela Cameletti. Spatial and Spatio-temporal Bayesian Models with R-INLA. John Wiley & Sons, 2015.

Examples

1
2
3
4
5
6
7
8
data(sp)

mod <- inla(aan ~ f(id, model = 'bym', graph = sp.adj),
             family = 'poisson', data = spn, E= eaan,
             control.predictor = list(link = 1, compute = TRUE))

p_vals <- PredPValue(mod)
p_vals$p_tails

oswaldosantos/INLAOutputs documentation built on May 24, 2019, 5 p.m.