marg.mv: Marginal Mean/Variance

View source: R/marg.mv.r

marg.mvR Documentation

Marginal Mean/Variance

Description

Function marg.mv can be used to calculate marginal means/variances, with corresponding interval obtained using posterior simulation.

Usage


marg.mv(x, eq, newdata, fun = "mean", n.sim = 100, prob.lev = 0.05, bin.model = NULL)

Arguments

x

A fitted marg.mv object as produced by the respective fitting function.

eq

Number of equation of interest.

newdata

A data frame with one row, which must be provided.

fun

Either mean or variance.

n.sim

Number of simulated coefficient vectors from the posterior distribution of the estimated model parameters.

prob.lev

Overall probability of the left and right tails of the simulated distribution used for interval calculations.

bin.model

If a two part or hurdle model is used then this is the object of a binary regression model fitted using gam() from mgcv.

Details

marg.mv() calculates the marginal mean or variance. Posterior simulation is used to obtain a confidence/credible interval.

Value

res

It returns three values: lower confidence interval limit, estimated marginal mean or variance and upper interval limit.

prob.lev

Probability level used.

sim.mv

It returns a vector containing simulated values of the marginal mean or variance. This is used to calculate intervals.

Author(s)

Maintainer: Giampiero Marra giampiero.marra@ucl.ac.uk

See Also

GJRM-package, gjrm


GJRM documentation built on Oct. 25, 2024, 5:07 p.m.