Skip to content

Commit

Permalink
version 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Antony M. Overstall authored and gaborcsardi committed May 19, 2014
1 parent 33027f7 commit 826428e
Show file tree
Hide file tree
Showing 28 changed files with 131 additions and 131 deletions.
11 changes: 6 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
Package: conting
Type: Package
Title: Bayesian analysis of contingency tables
Version: 1.1
Date: 2013-08-13
Version: 1.2
Date: 2014-05-19
Author: Antony M. Overstall
Maintainer: Antony M. Overstall <antony@mcs.st-and.ac.uk>
Description: Bayesian analysis of complete and incomplete contingency tables.
Depends: R (>= 2.15.0), mvtnorm, BMS, gregmisc, tseries, coda
Depends: R (>= 2.15.0)
Imports: mvtnorm, BMS, gtools, tseries, coda
License: GPL-2
Packaged: 2013-08-13 11:52:03 UTC; antony
Packaged: 2014-05-19 08:56:34 UTC; antony
NeedsCompilation: no
Repository: CRAN
Date/Publication: 2013-08-13 14:14:11
Date/Publication: 2014-05-19 11:18:31
54 changes: 27 additions & 27 deletions MD5
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
4ecc9b3e72f4d4e72ce87929714b8b95 *DESCRIPTION
df390c53434517b304ac5db487184641 *NAMESPACE
b706038d52fabc00a28a51380c5e6d4d *DESCRIPTION
4eb234dfaf800c03afa81c02796821bd *NAMESPACE
9071b89c46380a7af6be8fae2db00948 *R/RJ_update.R
def339b59e64204e9db01335b77ac9e8 *R/accept_rate.R
e3f610f6d31b1bc65164baf540514209 *R/add_term.R
Expand Down Expand Up @@ -39,30 +39,30 @@ ebd49330a88bba6d4cc5cbfe048379ea *R/print.submod.R
a87c0874595f4b0e9c82c46433a2d942 *R/summary.bcct.R
25d8d4dc32f86840812605ab3a2068c5 *R/summary.bict.R
84ed36115620defbe585207a53a9c951 *R/total_pop.R
541e8cea9e1c1b3919e280b55fc0185d *data/AOH.rda
fe4c3af9426730958d340e3a9e4400bc *data/ScotPWID.rda
7b7dc8fe033b801beca671e7c5f72337 *data/heart.rda
8d82254257848f88f486321ede4abe5a *data/spina.rda
1f1432e37f4e9b009cad01ce9b9d1b7f *man/AOH.Rd
213c01a6d0c2eda18869d55bb9489176 *man/RJ_update.Rd
eb248dd9d75ec07f249a3d9403a1ac7a *man/ScotPWID.Rd
b091506c11211bf150355f66524064ac *data/AOH.rda
6b2eeb5eff0c2a126a0fdf3b3aa27c52 *data/ScotPWID.rda
4ca8cd66e7e86991d1a52e7c86c7ae67 *data/heart.rda
d875c73b09fd354b3b8d3a95150ab136 *data/spina.rda
65f7771242c0423d7968d4ff8d836981 *man/AOH.Rd
c59a0d8ebdd0d551f7f5c96bcf66fbae *man/RJ_update.Rd
ec37a3af3820a28b104d311b558dd1ea *man/ScotPWID.Rd
39ccf0125b327337c0550ae7fc737457 *man/accept_rate.Rd
d9f447355a532354e2f8b41e5d2acac9 *man/add_term.Rd
e414ba53354f2e22e65b8a48cb592d44 *man/bayespval.Rd
3cd1591981bd2dfbb69846962e1b8621 *man/bcct.Rd
49f48422e6cad93fd0309cda5cbcf061 *man/bcct.fit.Rd
fabbfb35ff261d407257a4c8fb5e0860 *man/beta_mode.Rd
2b817c028950d352cc737fe3b996fde0 *man/bict.Rd
7c302aa7411c09aa71574b950ab61b55 *man/bict.fit.Rd
c4106ef24cac2505ef2fa4237864bcb8 *man/conting-package.Rd
f1bc003c01ce0b21671db5d8d9479802 *man/find_cens.Rd
66b5f4ce685bfce8509391c7791a4eff *man/bayespval.Rd
6d6426f9c6d00294c9b1b6f90f530994 *man/bcct.Rd
40bef9490edf703b71b921d14aa849b8 *man/bcct.fit.Rd
734403917fcaea4abb4e0ed3347f492f *man/beta_mode.Rd
36fe5ee7bf4d00652521f54743f5d95a *man/bict.Rd
08e933c468edb53191deb60138e13361 *man/bict.fit.Rd
911ba39fb1098b331b84f5562e57f49d *man/conting-package.Rd
75dfa510d06fc4f833c0307efbebb630 *man/find_cens.Rd
f6cc7a2d7c7becac9d042db3d8221ace *man/formula2index.Rd
2221b75f9fdd3e39f988b9925c4c5ea4 *man/heart.Rd
e6e39adb2e2bef63009f4de08cc40a99 *man/index2model.Rd
8d884af41b1f9e433a627e15242d5c86 *man/inter_probs.Rd
578541bf41f1641963dffcd5c7fed62c *man/inter_stats.Rd
007795c85baa92565e801c8d72c05989 *man/iwls_mh.Rd
ebb168549c6e0e235a9c0e9eed74e81f *man/mod_probs.Rd
e89273d5b42fdd52f75e0c3975b83d6d *man/heart.Rd
8060a294901b371a30a2f0a551913088 *man/index2model.Rd
f40863dfc8288243eaa49bcb5372d423 *man/inter_probs.Rd
a94c8c784b04c87d639ba044987fa9f0 *man/inter_stats.Rd
9fa8bd4d2e20a0a749734eb7b3236a6b *man/iwls_mh.Rd
8e0d38c90ac23045edf28e171e0ee0aa *man/mod_probs.Rd
732cda659f9946674392863686a9079d *man/plot.pval.Rd
bfc260d840ef3e7f8e82b8d16a1920d5 *man/plot.totpop.Rd
9ed357ad8d7163b645444077cbc4923d *man/print.acceptrate.Rd
Expand All @@ -73,7 +73,7 @@ ee7d8c4af0498ac0d8961620a6489bdd *man/print.interprob.Rd
7c83cc1f2520f5758a7a7a99175cde0a *man/print.pval.Rd
070698f8fe7d331958ef2654b9ad5a1a *man/print.submod.Rd
cc0e7661d4000e4f6265fee7c47c384f *man/print.totpop.Rd
8ad0a3bc241a44368ea4109efaa24059 *man/spina.Rd
2c90630b4d84febacadd76e7e666e9d2 *man/sub_model.Rd
57191c0694a0b6b4f55a04009433641c *man/summary.bcct.Rd
e0b076dd277b6dc3fc20959fb1715570 *man/total_pop.Rd
8bdd02d37df143d803db2227eef9a7a1 *man/spina.Rd
6115857f543682fa084d355feb874718 *man/sub_model.Rd
c3c11c8fdf2e521ae48db9168c74840f *man/summary.bcct.Rd
ab7afab726bcb2996df79820f45c9184 *man/total_pop.Rd
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
import(mvtnorm, tseries, coda)
importFrom(gtools, combinations)
importFrom(BMS, bin2hex)
importFrom(BMS, hex2bin)
exportPattern("^[[:alpha:]]+")
Binary file modified data/AOH.rda
Binary file not shown.
Binary file modified data/ScotPWID.rda
Binary file not shown.
Binary file modified data/heart.rda
Binary file not shown.
Binary file modified data/spina.rda
Binary file not shown.
4 changes: 2 additions & 2 deletions man/AOH.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ A factor with levels \code{yes} \code{no} indicating the classification of hyper
These data are from a study in Western Australia. The study copied a larger study
from USA. See Knuiman & Speed (1988) for more details.

For details on the function \code{\link{bcct}} applied to these data, see Overstall & King (2013).
For details on the function \code{\link{bcct}} applied to these data, see Overstall & King (2014).
}
\source{
Knuiman, M.W. & Speed, T.P. (1988) Incorporating Prior Information into the
Analysis of Contingency Tables. \emph{Biometrics}, \bold{44}, 1061--1071.
}
\references{
Overstall, A.M. & King, R. (2013) conting: An R package for Bayesian analysis of
Overstall, A.M. & King, R. (2014) conting: An R package for Bayesian analysis of
complete and incomplete contingency tables. \emph{Technical Report}, University
of St Andrews, UK.
}
Expand Down
4 changes: 2 additions & 2 deletions man/RJ_update.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ A matrix giving the inverse of the prior variance matrix for the log-linear para
}
\details{
For the original algorithm see Forster et al (2012). For details on its application to log-linear models
see Overstall & King (2013), and the references therein.
see Overstall & King (2014), and the references therein.
}
\value{
The function will return a list with the following components:
Expand All @@ -60,7 +60,7 @@ The function will return a list with the following components:
Forster, J.J., Gill, R.C. & Overstall, A.M. (2012) Reversible jump methods for generalised linear models and generalised
linear mixed models. \emph{Statistics and Computing}, \bold{22}, 107--120.

Overstall, A.M. & King, R. (2013) conting: An R package for Bayesian analysis of
Overstall, A.M. & King, R. (2014) conting: An R package for Bayesian analysis of
complete and incomplete contingency tables. \emph{Technical Report}, University
of St Andrews, UK.
}
Expand Down
10 changes: 5 additions & 5 deletions man/ScotPWID.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,23 @@ A factor with levels \code{Young} \code{Old} indicating age (\code{Young} = <35
Note that the PWID observed by source \code{S4}, the HCV database, are not necessarily current
PWID. They are people who have a history of drug use. Therefore the count in the cell
corresponding to only being observed by the HCV database is an overcount. Overstall et al
(2013) use a modelling approach whereby the count in the cell corresponding to only being
(2014) use a modelling approach whereby the count in the cell corresponding to only being
observed by the HCV database is missing and the observed value acts as an upper bound. For
more details on the dataset see King et al (2013).

For details on the function \code{\link{bict}} applied to this data, see Overstall & King (2013).
For details on the function \code{\link{bict}} applied to this data, see Overstall & King (2014).
}
\source{
King, R., Bird, S. M., Overstall, A. M., Hay, G. & Hutchinson, S. J. (2013) Injecting drug
users in Scotland, 2006: Listing, number, demography, and opiate-related death-rates.
\emph{Addiction Research and Theory}, \bold{21}, 235-246.
}
\references{
Overstall, A.M., King, R., Bird, S.M., Hutchinson, S.J. & Hay, G. (2013) Incomplete contingency
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. \emph{Technical Report}, University of St Andrews.
in Scotland. \emph{Statistics in Medicine}, \bold{33}, 1564--1579.

Overstall, A.M. & King, R. (2013) conting: An R package for Bayesian analysis of
Overstall, A.M. & King, R. (2014) conting: An R package for Bayesian analysis of
complete and incomplete contingency tables. \emph{Technical Report}, University
of St Andrews, UK.
}
Expand Down
12 changes: 6 additions & 6 deletions man/bayespval.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ thinning.
}
\item{statistic}{
An optional argument giving the discrepancy statistic to use for calculating the Bayesian p-value. It can be one of
\code{c("deviance","X2","FreemanTukey")} which correspond to the different statistics:
\code{"deviance"} = deviance statistic, \code{"X2"} = Chi-squared statistic,
\code{"FreemanTukey"} = Freeman-Tukey statistic. See Overstall & King (2013), and references
\code{c("X2","FreemanTukey","deviance")} which correspond to the different statistics:
\code{"X2"} = Chi-squared statistic, \code{"FreemanTukey"} = Freeman-Tukey statistic,
\code{"deviance"} = deviance statistic. See Overstall & King (2014), and references
therein, for descriptions of these statistics.
}
}

\details{See Gelman et al (2004, Chapter 6) for more details on Bayesian p-values and see
Overstall & King (2013), and references therein, for details of their application to
Overstall & King (2014), and references therein, for details of their application to
contingency tables.

The use of thinning is recommended when the number of MCMC iterations and/or the number of
log-linear parameters in the maximal model are/is large, which may cause problems with
computer memory storage.
comuter memory storage.
}

\value{
Expand All @@ -61,7 +61,7 @@ and their means.}
\references{
Gelman, A., Carlin, J.B., Stern, H.S. & Rubin, D.B. (2004) \emph{Bayesian Data Analysis}, 2nd edition, Chapman & Hall.

Overstall, A.M. & King, R. (2013) conting: An R package for Bayesian analysis of
Overstall, A.M. & King, R. (2014) conting: An R package for Bayesian analysis of
complete and incomplete contingency tables. \emph{Technical Report}, University
of St Andrews, UK.
}
Expand Down
25 changes: 12 additions & 13 deletions man/bcct.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
\title{
Bayesian Analysis of Complete Contingency Tables
}
\encoding{UTF-8}
\description{
These functions implement a Bayesian analysis of complete contingency tables. This is
accomplished using an MCMC algorithm where the null moves are performed using
Expand Down Expand Up @@ -37,7 +36,7 @@ model. If the model variables are not found in \code{data}, the variables are ta
A numeric scalar giving the number of (additional, in the case of \code{bcctu}) MCMC iterations to perform.
}
\item{prior}{An optional argument giving the prior to be used in the analysis. It can be one of
\code{c("UIP","SBH")}, where \code{"UIP"} = unit information prior; and \code{"SBH"} = Sabanes-Bové & Held prior. The
\code{c("UIP","SBH")}, where \code{"UIP"} = unit information prior; and \code{"SBH"} = Sabanes-Bove & Held prior. The
default value is \code{"SBH"}.
}

Expand All @@ -53,7 +52,7 @@ implied by the argument \code{start.formula}. If \code{NULL} (the default) the s
posterior mode under the maximal model.
}
\item{start.sig}{
An optional argument giving the starting value of sigma^2 (under the Sabanes-Bové & Held prior) for the
An optional argument giving the starting value of sigma^2 (under the Sabanes-Bove & Held prior) for the
MCMC algorithm when the argument of prior is \code{"SBH"}. If \code{NULL} (the default) the starting
value will be one.
}
Expand All @@ -79,11 +78,11 @@ An optional scalar argument giving the probability of performing a null move in
algorithm, i.e. proposing a move to the current model. The default value is 0.5.
}
\item{a}{
The shape hyperparameter of the Sabanes-Bové & Held prior, see Overstall & King (2013). The default value
The shape hyperparameter of the Sabanes-Bove & Held prior, see Overstall & King (2014). The default value
is 0.001.
}
\item{b}{
The scale hyperparameter of the Sabanes-Bové & Held prior, see Overstall & King (2013). The default value
The scale hyperparameter of the Sabanes-Bove & Held prior, see Overstall & King (2014). The default value
is 0.001.
}
\item{progress}{
Expand All @@ -93,15 +92,15 @@ Logical argument. If \code{TRUE}, then a progress bar will be displayed. The def
}
\details{
For identifiability, the parameters are constrained. The \code{\link{conting-package}} uses sum-to-zero constraints.
See Overstall & King (2013), and the references therein, for more details.
See Overstall & King (2014), and the references therein, for more details.

The Metropolis-Hastings algorithm employed is the iterated weighted least squares method for
generalised linear models (GLMs) proposed by Gamerman (1997). The reversible jump algorithm employed is
that orthogonal projections method for GLMs proposed by Forster et al (2012). For details on these
methods applied to log-linear models see Overstall & King (2013), and the references therein.
methods applied to log-linear models see Overstall & King (2014), and the references therein.

For details on the unit information and Sabanes-Bové & Held priors for generalised linear models see Ntzoufras
et al (2003) and Sabanes-Bové & Held (2011), respectively. See Overstall & King (2013), and the references therein,
For details on the unit information and Sabanes-Bove & Held priors for generalised linear models see Ntzoufras
et al (2003) and Sabanes-Bove & Held (2011), respectively. See Overstall & King (2014), and the references therein,
for their application to log-linear models and contingency tables.

}
Expand All @@ -114,7 +113,7 @@ to a log-linear parameter which is not present for the current model a zero is r

\item{MODEL}{A vector of length \code{n.sample} giving the sampled model indicators in hexadecimal format.}

\item{SIG}{A vector of length \code{n.sample} giving the sampled values for sigma^2 under the Sabanes-Bové & Held prior. If the
\item{SIG}{A vector of length \code{n.sample} giving the sampled values for sigma^2 under the Sabanes-Bove & Held prior. If the
unit information prior is used then the components of this vector will be one.}

\item{rj_acc}{A binary vector of the same length as the number of reversible jump moves attempted. A 0 indicates
Expand Down Expand Up @@ -149,7 +148,7 @@ The argument \code{b}.
}
}
\references{
Sabanes-Bové, D. & Held, L. (2011) Hyper-g priors for generalized linear models. \emph{Bayesian
Sabanes-Bove, D. & Held, L. (2011) Hyper-g priors for generalized linear models. \emph{Bayesian
Analysis}, \bold{6}, 387--410.

Forster, J.J., Gill, R.C. & Overstall, A.M. (2012) Reversible jump methods for generalised linear models and generalised
Expand All @@ -162,7 +161,7 @@ Nztoufras, I., Dellaportas, P. & Forster, J.J. (2003) Bayesian variable and link
determination for generalised linear models. \emph{Journal of Statistical Planning and
Inference}, \bold{111}, 165--180.

Overstall, A.M. & King, R. (2012) conting: An R package for Bayesian analysis of
Overstall, A.M. & King, R. (2014) conting: An R package for Bayesian analysis of
complete and incomplete contingency tables. \emph{Technical Report}, University
of St Andrews, UK.
}
Expand Down Expand Up @@ -250,7 +249,7 @@ summary(test1)
#
#Bayesian p-value = 0.28

## For more examples see Overstall & King (2013).
## For more examples see Overstall & King (2014).


}
9 changes: 4 additions & 5 deletions man/bcct.fit.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
\title{
Bayesian Analysis of Complete Contingency Tables
}
\encoding{UTF-8}
\description{
This function is the workhorse behind \code{\link{bcct}} and \code{\link{bcctu}}.
}
Expand Down Expand Up @@ -54,10 +53,10 @@ A scalar argument giving the probability of performing a null move, i.e. proposi
current model.
}
\item{a}{
The shape hyperparameter of the Sabanes-Bové & Held prior, see Overstall & King (2013).
The shape hyperparameter of the Sabanes-Bove & Held prior, see Overstall & King (2014).
}
\item{b}{
The scale hyperparameter of the Sabanes-Bové & Held prior, see Overstall & King (2013).
The scale hyperparameter of the Sabanes-Bove & Held prior, see Overstall & King (2014).
}
\item{progress}{
Logical argument. If \code{TRUE}, then a progress bar will be displayed.
Expand All @@ -74,7 +73,7 @@ to a log-linear parameter which is not present for the current model a zero is r

\item{MODEL}{A vector of length \code{iters} giving the sampled model indicators in hexadecimal form.}

\item{SIG}{A vector of length \code{iters} giving the sampled values for sigma^2 under the Sabanes-Bové & Held prior. If the
\item{SIG}{A vector of length \code{iters} giving the sampled values for sigma^2 under the Sabanes-Bove & Held prior. If the
unit information prior is used then the components of this vector will be one.}

\item{rj_acc}{A binary vector of the same length as the number of reversible jump moves attempted. A 0 indicates
Expand All @@ -86,7 +85,7 @@ that the proposal was rejected, and a 1 that the proposal was accepted.}
}

\references{
Overstall, A.M. & King, R. (2013) conting: An R package for the Bayesian analysis of
Overstall, A.M. & King, R. (2014) conting: An R package for the Bayesian analysis of
complete and incomplete contingency tables. \emph{Technical Report}, University of St Andrews.
}

Expand Down

0 comments on commit 826428e

Please sign in to comment.