hwe.ibf.mc: Testing Hardy-Weinberg Equilibrium Using an Intrinsic Prior...

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/HWEintrinsic.R

Description

This function implements the Monte Carlo estimation of the Bayes factor based on intrinsic priors for the Hardy-Weinberg testing problem as described in Consonni et al. (2011).

Usage

1
hwe.ibf.mc(y, t, M = 10000, verbose = TRUE)

Arguments

y

an object of class "HWEdata".

t

training sample size.

M

number of Monte Carlo iterations.

verbose

logical; if TRUE the function prints the detailed calculation progress.

Details

This function implements a Monte Carlo approximation using importance sampling of the Bayes factor based on intrinsic priors.

Value

hwe.ibf.mc returns an object of the class "HWEintr".

Note

The Bayes factor computed here is for the unrestricted model (M_1) against the Hardy-Weinberg case (M_0).

Author(s)

Sergio Venturini sergio.venturini@unibocconi.it

References

Consonni, G., Moreno, E., and Venturini, S. (2011). "Testing Hardy-Weinberg equilibrium: an objective Bayesian analysis". Statistics in Medicine, 30, 62–74. http://onlinelibrary.wiley.com/doi/10.1002/sim.4084/abstract

See Also

hwe.ibf, hwe.ibf.plot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Example 1 #
## Not run: 
# ATTENTION: the following code may take a long time to run! #


data(GuoThompson9)
plot(GuoThompson9)
n <- sum(GuoThompson9@data.vec, na.rm = TRUE)
out <- hwe.ibf.mc(GuoThompson9, t = n/2, M = 100000, verbose = TRUE)
summary(out, plot = TRUE)

## End(Not run)

# Example 2 #
## Not run: 
# ATTENTION: the following code may take a long time to run! #

M <- 300000
f <- seq(.1, 1, .05)
n <- sum(GuoThompson9@data.vec, na.rm = TRUE)
out <- hwe.ibf.plot(y = GuoThompson9, t.vec = round(f*n), M = M)

## End(Not run)

HWEintrinsic documentation built on May 2, 2019, 12:20 p.m.