Learn R Programming

MCMCpack (version 0.3-11)

dtomogplot: Dynamic Tomography Plot

Description

dtomogplot is used to produce a tomography plot (see King, 1997) for a series of temporally ordered, partially observed 2 x 2 contingency tables.

Usage

dtomogplot(r0, r1, c0, c1, time.vec=NA,
           xlab="fraction of r0 in c0 (p0)",
           ylab="fraction of r1 in c0 (p1)",
           color.palette=heat.colors, bgcol="black", ...)

Arguments

r0
(ntables * 1) vector of row sums from row 0
r1
(ntables * 1) vector of row sums from row 1
c0
(ntables * 1) vector of column sums from column 0
c1
(ntables * 1) vector of column sums from column 1
time.vec
vector of time periods that correspond to the elements of r0, r1, c0, and c1
xlab
the x axis label for the plot
ylab
the y axis label for the plot
color.palette
Color palette to be used to encode temporal patterns
bgcol
the background color for the plot
...
further arguments to be passed

Details

Consider the following partially observed 2 by 2 contingency table: llll{ | $Y=0$ | $Y=1$ | - - - - - - - - - - - - - - - - - - - - $X=0$ | $Y_0$ | | $r_0$ - - - - - - - - - - - - - - - - - - - - $X=1$ | $Y_1$ | | $r_1$ - - - - - - - - - - - - - - - - - - - - | $c_0$ | $c_1$ | $N$ }

where $r_0$, $r_1$, $c_0$, $c_1$, and $N$ are non-negative integers that are observed. The interior cell entries are not observed. It is assumed that $Y_0|r_0 \sim \mathcal{B}inomial(r_0, p_0)$ and $Y_1|r_1 \sim \mathcal{B}inomial(r_1, p_1)$.

dtomogplot plots the bounds on the MLEs for (p0, p1) and color codes them by the elements of time.vec.

References

Gary King, 1997. A Solution to the Ecological Inference Problem. Princeton: Princeton University Press. Jonathan Wakefield. 2001. ``Ecological Inference for 2 x 2 Tables,'' Center for Statistics and the Social Sciences Working Paper no. 12. University of Washington.

Kevin M. Quinn. 2002. ``Ecological Inference in the Presence of Temporal Dependence.'' Paper prepared for Ecological Inference Conference, Harvard University, June 17-18, 2002.

See Also

MCMCbaselineEI, MCMChierEI, MCMCdynamicEI, plot.mcmc,summary.mcmc

Examples

Run this code
r0 <- rpois(20, 300)
r1 <- rpois(20, 200)
c0 <- 100 + 1:20*7 + rpois(20, 30)
c1 <- (r0+r1) - c0
dtomogplot(r0, r1, c0, c1, time.vec=1901:1920)

Run the code above in your browser using DataLab