R Programming/Estimation utilities

This page deals with methods which are available for most estimation commands. This can be useful for all kind of regression models.

Formulas
Most estimation commands use a formula interface. The outcome is left of the  and the covariates are on the right.

It is easy to include multinomial variable as predictive variables in a model. If the variable is not already a factor, one just need to use the  function. This will create a set of dummy variables.

For instance, we can use the Star data in the Ecdat package :

takes arguments "as is". For instance, if you want to include in your equation a modified variable such as a squarred term or the addition of two variables, you may use.

It is easy to include interaction between variables by using  or. adds all interaction terms whereas  adds interaction terms and individual terms.

It is also possible to generate polynomials using the  function with option.

There is also an advanced formula interface which is useful for instrumental variables models and mixed models. For instance  (AER) uses this advanced formulas interface. The instrumental variables are entered after the. See the Instrumental Variables section if you want to learn more.

Output
In addition to the  and   functions which display the output for most estimation commands, some authors have developed simplified output functions. One of them is the  function in the arm package. Another one is the  in the arm package which displays the coefficients with confidence intervals in a plot. According to the standards defined by Nathaniel Beck, Jeff Gill developped. This command does not show useless auxiliary statistics.

Delta Method

 * If you want to know the standard error of a transformation of one of your parameter, you need to use the delta method
 * in the msm package.
 * in the alr3 package.
 * in the car package.

Zelig : the pseudo-bootstrap method
Zelig is a postestimation package which simulates in the distribution of the estimated parameters and computes the quantities of interest such as marginal effects or predicted probabilities. This is especially useful for non-linear models. Zelig comes with a set of vignettes which explain how to deal with each kind of model. There are three commands.
 * estimates the model and draws from the distribution of estimated parameters.
 * fixes the values of explanatory variables.
 * computes the quantities of interest.