r-quantities / errors

Uncertainty Propagation for R Vectors
https://r-quantities.github.io/errors
Other
49 stars 8 forks source link

Feature Request: Simplify working with contrasts #28

Open billdenney opened 6 years ago

billdenney commented 6 years ago

After generating a linear model, I often need to do subsequent operations to compute differences between contrasts and more accurately the difference between the coefficients of the fixed effects. Typically, I do this with the contrast package, but I also often need to compare multiple sets of contrasts which I can't do with contrast (as far as I know).

It would be helpful if I could provide a contrast matrix, a vector of coefficients (or fixed effects), and a variance-covariance matrix and use that to operate on the fixed effects of a model. I'd guess that this would be a new subclass of "errors" (something like a class of c("contrast_errors", "errors")) where the main "errors" object would work on the contrast values directly, and the "contrast_errors" object would work at the coefficient/fixed effects levels.

What do you think?

Enchufa2 commented 6 years ago

Sorry, I'm not familiar with contrasts; an example would be helpful. How do you use errors with contrasts and what do you want to simplify?