simulateConditional: Simulates from the conditional distribution of a log-linear...

Description Usage Arguments Value Author(s) See Also Examples

Description

Simulates from the conditional distribution of log-linear models given the sufficient statistics.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
simulateConditional(formula,
                     data,
                     dens = hyper,
                     nosim = 10^3,
                     method = "bab",
                     tdf = 3,
                     maxiter = nosim,
                     p = NULL,
                     y.start = NULL)
simtable.bab(args, nosim = NULL, maxiter = NULL)
simtable.cab(args, nosim = NULL, p = NULL, y.start = NULL)

Arguments

formula

A formula for the log-linear model

data

A data frame

dens

The target density on the log scale up to a constant of proportionallity. A function of the form function(y). Current default is (proportional to) the log of the generalized hypergeometric density.

nosim

Desired number of simulations.

method

Possibly two values, the importance sampling method of Booth and Butler, method = "bab" or the MCMC approach of Caffo and Booth method = "cab".

tdf

A tuning parameter

maxiter

For method = "bab" number of iterations is different from the number of simulations. maxiter is a bound on the total number of iterations.

p

A tuning parameter for method = "cab".

y.start

An optional starting value when method = "cab"

args

An object of class "bab" or "cab"

Value

A matrix where each simulated table is a row.

Author(s)

Brian Caffo

See Also

fisher.test

Examples

1
2
3
4
5
6
7
data(czech.dat)
chain2 <- simulateConditional(y ~ (A + B + C + D + E + F) ^ 2,
                               data = czech.dat,
                               method = "cab",
                               nosim = 10 ^ 3,
                               p = .4,
                               dens = function(y) 0)


Search within the exactLoglinTest package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.