repl                  package:Zelig                  R Documentation

_R_e_p_l_i_c_a_t_i_n_g _A_n_a_l_y_s_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     The generic function 'repl' command takes  'zelig' or 'sim' output
     objects and replicates (literally, re-runs) the entire analysis. 
     The results should be an output  object identical to the original
     input object in the case of 'zelig' output.  In the case of 'sim'
     output, the replicated analyses may differ slightly due to
     stochastic randomness in the simulation procedure.

_U_s_a_g_e:

     repl(object, data, ...)
     ## Default S3 method:
     repl(object, data = NULL, ...)
     ## S3 method for class 'zelig':
     repl(object, data = NULL, prev = NULL, x = NULL, x1 = NULL,
          bootfn = NULL, ...) 

_A_r_g_u_m_e_n_t_s:

  object: Stored output from either 'zelig' or 'sim'.

    data: You may manually input the data frame name rather than
          allowing 'repl' to draw the data frame name from the object
          to be replicated.

    prev: When replicating 'sim' output, you may optionally use the
          previously simulated parameters to calculate the quantities
          of interest rather than simulating a new set of parameters. 
          For all models, this should produce identical quantities of
          interest.  In addition, for if the parameters were
          bootstrapped in the original analysis, this will save a
          considerable amount of time. 

       x: When replicating 'sim' output, you may optionally use an
          alternative 'setx' value for the 'x' input. 

      x1: When replicating 'sim' output, you may optionally use an
          alternative 'setx' object for the 'x1' input to replicating
          the 'sim' object. 

  bootfn: When replicating 'sim' output with bootstrapped parameters,
          you should manually specify the 'bootfn' if a non-default
          option was used.  

     ...: Additional arguments passed to either 'zelig' or  'sim'.  

_V_a_l_u_e:

     For 'zelig' output, 'repl' will create output that is in every way
     identical to the original input.  You may check to see whether
     they are identical by using the 'identical' command.  

     For 'sim' output, 'repl' output will be will be identical to the
     original object if you choose not to simulate new parameters, and
     instead choose to calculate quantities of interest using the
     previously simulated parameters (using the 'prev' option.  If you
     choose to simulate new parameters, the summary statistics for each
     quantity of interest should be identical, up to a random
     approximation error.  As the number of simulations increases, this
     error decreases.

_A_u_t_h_o_r(_s):

     Kosuke Imai <kimai@princeton.edu>; Gary King <king@harvard.edu>;
     Olivia Lau <olau@fas.harvard.edu>

_S_e_e _A_l_s_o:

     'zelig', 'setx', and 'sim'.  In addition, the full Zelig manual
     may be accessed online at <URL: http://gking.harvard.edu/zelig>.

_E_x_a_m_p_l_e_s:

     data(turnout)
     z.out <- zelig(vote ~ race + educate, model = "logit", data = turnout[1:1000,])
     x.out <- setx(z.out)
     s.out <- sim(z.out, x = x.out)
     z.rep <- repl(z.out)
     identical(z.out$coef, z.rep$coef)
     z.alt <- repl(z.out, data = turnout[1001:2000,])
     s.rep <- repl(s.out, prev = s.out$par)
     identical(s.out$ev, s.rep$ev)

