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)

