wasps-package: Statistical tools for detecting over- or under-dispersion

Description Details Author(s) References See Also Examples

Description

Contains an implementation of the Meelis and James hypothesis tests for detecting under or over-dispersion in count data. Also calculates the R statistic. Implements the Bayesian model selection methods developed in Wilkinson et al 2013.

Details

Package: precision
Type: Package
Version: 1.0
Date: 2013-10-6
License: GPL version 2 or newer

~~ An overview of how to use the package, including the most important ~~ ~~ functions ~~

Author(s)

Richard Wilkinson <r.d.wilkinson@nottingham.ac.uk>

References

Wilkinson et al. 2013.

See Also

~~ Optional links to other man pages, e.g. ~~ ~~ <pkg> ~~

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#demo("ModelEvidence", package="precision")
#demo("MCMC", package="precision")

library(precision)
data(GlegneriSecondary)
meelis.out <- Meelis.test(GlegneriSecondary, TwoSided=TRUE)
james.out = James.test(GlegneriSecondary, TwoSided=TRUE)


########### Run the MCMC
## prior for p is beta(a, b)
hyper$a.p <-  1 ## 20   ## Hyper parameters for p's prior distribution
hyper$b.p <-  1##100

# prior for psi - assumed to be Gaussian
hyper$mu.psi <- 0  
hyper$sd.psi <- 1

## Define a start point for the MCMC chain -
b.theta0 <-c(10, 0.1, 0.5) 
names(b.theta0) <-c("lambda", "p", "mort")

b.mcmc.out <- MCMCWithinGibbs( theta0=b.theta0,  data=GlegneriSecondary, hyper=hyper, nbatch=10^3, family="binomial", keepNM=TRUE)

# calculate the model evidence
b.log.evidence <- CalculateEvidence(mcmc.out=b.mcmc.out, data=GlegneriSecondary,  hyper=hyper, family="binomial", sd=FALSE)

rich-d-wilkinson/precision documentation built on May 27, 2019, 7:41 a.m.