sim | R Documentation |
Simulate quantities of interest from the estimated model
output from zelig()
given specified values of explanatory
variables established in setx()
. For classical maximum
likelihood models, sim()
uses asymptotic normal
approximation to the log-likelihood. For Bayesian models,
Zelig simulates quantities of interest from the posterior density,
whenever possible. For robust Bayesian models, simulations
are drawn from the identified class of Bayesian posteriors.
Alternatively, you may generate quantities of interest using
bootstrapped parameters.
sim(obj, x, x1, y = NULL, num = 1000, bootstrap = F, bootfn = NULL,
cond.data = NULL, ...)
obj |
output object from |
x |
values of explanatory variables used for simulation,
generated by |
x1 |
optional values of explanatory variables (generated by a
second call of |
y |
a parameter reserved for the computation of particular quantities of interest (average treatment effects). Few models currently support this parameter |
num |
an integer specifying the number of simulations to compute |
bootstrap |
currently unsupported |
bootfn |
currently unsupported |
cond.data |
currently unsupported |
... |
arguments reserved future versions of Zelig |
This documentation describes the sim
Zelig 4 compatibility wrapper
function.
The output stored in s.out
varies by model. Use the
names
function to view the output stored in s.out
.
Common elements include:
x |
the |
x1 |
the optional |
call |
the options selected for |
zelig.call |
the original function and options for
|
num |
the number of simulations requested. |
par |
the parameters (coefficients, and additional model-specific parameters). You may wish to use the same set of simulated parameters to calculate quantities of interest rather than simulating another set. |
qi\$ev |
simulations of the expected values given the
model and |
qi\$pr |
simulations of the predicted values given by the fitted values. |
qi\$fd |
simulations of the first differences (or risk
difference for binary models) for the given |
qi\$rr |
simulations of the risk ratios for binary and multinomial models. See specific models for details. |
qi\$ate.ev |
simulations of the average expected
treatment effect for the treatment group, using conditional
prediction. Let
where |
qi\$ate.pr |
simulations of the average predicted
treatment effect for the treatment group, using conditional
prediction. Let
where |
Christopher Gandrud, Matt Owen, Olivia Lau and Kosuke Imai
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.