jointprobs {CorrBin} | R Documentation |
Estimate joint event probabilities for multinomial data
Description
An exchangeable multinomial distribution with K+1
categories O_1,\ldots,O_{K+1}
, can be
parameterized by the joint probabilities of events
\tau_{r_1,\ldots,r_{K}|n} = P\big[X_1=\cdots=X_{r_1}=O_1,\ldots, X_{\sum_{i=1}^{K-1}r_i+1} =\cdots=X_{\sum_{i=1}^{K}r_i}=O_K\big]
where r_i \geq 0
and r_1+\cdots +r_K\leq n
.
The jointprobs
function estimates these probabilities under various settings.
Note that when some of the r_i
's equal zero, then no restriction on the number of outcomes of the
corresponding type are imposed, so the resulting probabilities are marginal.
Usage
jointprobs(cmdata, type = c("averaged", "cluster", "mc"))
Arguments
cmdata |
a |
type |
character string describing the desired type of estimate:
|
Value
a list with an array of estimates for each treatment. For a multinomial distribution with
K+1
categories the arrays will have either K+1
or K dimensions, depending on whether
cluster-size specific estimates (type="cluster"
) or pooled estimates
(type="averaged"
or type="mc"
) are requested. For the cluster-size specific estimates
the first dimension is the cluster-size. Each additional dimension is a possible outcome.
See Also
mc.est
for estimating the distribution under marginal compatibility,
uniprobs
and multi.corr
for extracting the univariate marginal event
probabilities, and the within-multinomial correlations from the joint probabilities.
Examples
data(dehp)
# averaged over cluster-sizes
tau.ave <- jointprobs(dehp, type="ave")
# averaged P(X1=X2=O1, X3=O2) in the 1500 dose group
tau.ave[["1500"]]["2","1"] # there are two type-1, and one type-2 outcome
#plot P(X1=O1) - the marginal probability of a type-1 event over cluster-sizes
tau <- jointprobs(dehp, type="cluster")
ests <- as.data.frame(lapply(tau, function(x)x[,"1","0"]))
matplot(ests, type="b")