Learn R Programming

CorrBin (version 1.6.2)

mc.est.CMData: Distribution of the number of responses assuming marginal compatibility.

Description

The mc.est function estimates the distribution of the number of responses in a cluster under the assumption of marginal compatibility: information from all cluster sizes is pooled. The estimation is performed independently for each treatment group.

Usage

# S3 method for CMData
mc.est(object, eps = 1e-06, ...)

# S3 method for CBData mc.est(object, ...)

mc.est(object, ...)

Value

For CMData: A data frame giving the estimated pdf for each treatment and clustersize. The probabilities add up to 1 for each Trt/ClusterSize combination. It has the following columns:

Prob

numeric, the probability of NResp responses in a cluster of size ClusterSize in group Trt

Trt

factor, the treatment group

ClusterSize

numeric, the cluster size

NResp.1 - NResp.K

numeric, the number of responses of each type

For CBData: A data frame giving the estimated pdf for each treatment and clustersize. The probabilities add up to 1 for each Trt/ClusterSize combination. It has the following columns:

Prob

numeric, the probability of NResp responses in a cluster of size ClusterSize in group Trt

Trt

factor, the treatment group

ClusterSize

numeric, the cluster size

NResp

numeric, the number of responses

Arguments

object

a CBData or CMData object

eps

numeric; EM iterations proceed until the sum of squared changes fall below eps

...

other potential arguments; not currently used

Author

Aniko Szabo

Details

The EM algorithm given by Stefanescu and Turnbull (2003) is used for the binary data.

References

George EO, Cheon K, Yuan Y, Szabo A (2016) On Exchangeable Multinomial Distributions. #'Biometrika 103(2), 397-408.

Stefanescu, C. & Turnbull, B. W. (2003) Likelihood inference for exchangeable binary data with varying cluster sizes. Biometrics, 59, 18-24

Examples

Run this code
data(dehp)
dehp.mc <- mc.est(subset(dehp, Trt=="0"))
subset(dehp.mc, ClusterSize==2)

data(shelltox)
sh.mc <- mc.est(shelltox)

if (require(lattice)){
xyplot(Prob~NResp|factor(ClusterSize), groups=Trt, data=sh.mc, subset=ClusterSize>0, 
   type="l", as.table=TRUE, auto.key=list(columns=4, lines=TRUE, points=FALSE),
   xlab="Number of responses", ylab="Probability P(R=r|N=n)")
}

Run the code above in your browser using DataLab