Description Usage Arguments Details Value Author(s) References See Also Examples
Given all the sources and the censored source of an incomplete contingency table, this function will find the censored cells.
1 |
sources |
An object of class |
cens_source |
An object of class |
data |
An object of class |
unobs.level |
The character string used to label the source level corresponding to not observing the individuals in the cell. |
obs.level |
The character string used to label the source level corresponding to observing the individuals in the cell. |
Sometimes one of the sources (termed the censored source) used to estimate closed populations observes individuals which are not members of the target population. In this case we assume that when this source observes an individual that has been observed by at least one other source, then it is a member of the target population. However those individuals only observed by the censored source contain a mixture of members of the target and non-target populations. This means that the observed cell count acts as an upper bound on the true cell count. For more details on this approach, see Overstall et al (2014) and Overstall & King (2014). This function identifies the cells which are censored (i.e. correspond to only being observed by the censored source).
The function will output a numeric vector containing the cell numbers of the censored cells. These are
used by the bict
and bictu
functions.
Antony M. Overstall A.M.Overstall@soton.ac.uk.
Overstall, A.M., King, R., Bird, S.M., Hutchinson, S.J. & Hay, G. (2014) Incomplete contingency tables with censored cells with application to estimating the number of people who inject drugs in Scotland. Statistics in Medicine, 33 (9), 1564–1579.
Overstall, A.M. & King, R. (2014) conting: An R package for Bayesian analysis of complete and incomplete contingency tables. Journal of Statistical Software, 58 (7), 1–27. http://www.jstatsoft.org/v58/i07/
bict
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | data(ScotPWID)
## Load the ScotPWID data. In this dataset, the S4 source corresponding
## to the HCV database is subject to censoring. We use find_cens to find
## the censored cells.
find_cens(sources=~S1+S2+S3+S4,cens_source=~S4,data=ScotPWID)
## It will produce the vector with the following elements:
##[1] 9 25 41 57 73 89 105 121
## Let's look at these cells
ScotPWID[find_cens(sources=~S1+S2+S3+S4,cens_source=~S4,data=ScotPWID),]
## It will produce:
# y S1 S2 S3 S4 Region Gender Age
#9 122 un un un obs GGC Male Young
#25 135 un un un obs GGC Male Old
#41 48 un un un obs GGC Female Young
#57 38 un un un obs GGC Female Old
#73 134 un un un obs Rest Male Young
#89 104 un un un obs Rest Male Old
#105 78 un un un obs Rest Female Young
#121 25 un un un obs Rest Female Old
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.