jc.probs: Joint or conditional probabilities from a fitted joint model

Description Usage Arguments Details Value Author(s) See Also

View source: R/jc.probs.r

Description

jc.probs can be used to calculate the joint or conditional probabilities from a fitted joint model with intervals obtained using posterior simulation.

Usage

1
2
3
jc.probs(x, y1, y2, y3 = NULL, newdata, type = "joint", cond = 0,
         intervals = FALSE, n.sim = 100, prob.lev = 0.05, min.pr = 1e-323, max.pr = 1, 
         cumul = "no")

Arguments

x

A fitted gjrm object as produced by the respective fitting function.

y1

Value of response for first margin.

y2

Value of response for second margin.

y3

Value of response for third margin if a trivariate model is employed.

newdata

A data frame or list containing the values of the model covariates at which predictions are required. If not provided then predictions corresponding to the original data are returned. When newdata is provided, it should contain all the variables needed for prediction.

type

This argument can take two: "joint" (the probabilities are calculated from the fitted joint model) and "independence" (the calculation is done from univariate fits).

cond

There are three possible values: 0 (joint probabilities are delivered), 1 (conditional probabilities are delivered and conditioning is with the respect to the first margin), 2 (as before but conditioning is with the respect to the second margin).

intervals

If TRUE then intervals for the probabilities are also produced.

n.sim

Number of simulated coefficient vectors from the posterior distribution of the estimated model parameters. This is used for interval calculations.

prob.lev

Overall probability of the left and right tails of the probabilities' distributions used for interval calculations.

min.pr, max.pr

Allowed minimum and maximum for estimated probabities.

cumul

Only used for discrete and continuous margins' case.

Details

This function calculates joint or conditional probabilities from a fitted joint model or a model assuming independence, with intervals obtained using posterior simulation.

Value

res

It returns several values including: estimated probabilities (p12), with lower and upper interval limits (CIpr) if intervals = TRUE, and p1, p2 and p3 (the marginal probabilities).

Author(s)

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

See Also

GJRM-package, gjrm


KironmoyDas/KD-STAT0035-GMupdate documentation built on Feb. 15, 2021, 12:17 a.m.