Skip to content
Prev 164711 / 398502 Next

Functions in R like lincom and nlcom of Stata

On Sat, 13 Dec 2008, Stas Kolenikov wrote:

            
It really depends on the class of models, e.g. se.contrast() applies to 
aov models, including multistratum ones.

In general (as it is generic) vcov() provides a good starting point.

For linear models there are lots of approaches in contributed packages.
(E.g. gmodels::estimable, car::linear.hypothesis, the effects package.)

That said, I find myself needing this very rarely.  Two general principles 
may help

1) set up models so the quantities of interest are parameters (and for 
linearly-parametrized models, use C() and contrasts() to do so).

2) Interesting quantities from models are almost always based on 
predictions, and hence most often only linear combinations of parameters 
in linear models.  Simulation is a good way to assess the uncertainty of 
such quantities.