simulateConditional     package:exactLoglinTest     R Documentation

_S_i_m_u_l_a_t_e_s _f_r_o_m _t_h_e _c_o_n_d_i_t_i_o_n_a_l _d_i_s_t_r_i_b_u_t_i_o_n _o_f _a _l_o_g-_l_i_n_e_a_r _m_o_d_e_l

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

     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)

_A_r_g_u_m_e_n_t_s:

 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"

_V_a_l_u_e:

     A matrix where each simulated table is a row.

_A_u_t_h_o_r(_s):

     Brian Caffo

_S_e_e _A_l_s_o:

     'fisher.test'

_E_x_a_m_p_l_e_s:

     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)

