Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Equivalent of nlcom (Stata) in R? Nonlinear transformations of regression coefficients

Tags:

r

coefficients

I would like to perform a nonlinear transformation of a regression coefficient. For example:

, or

.

Stata has a convenient implementation with nlcom this that employs the delta method to estimate standard errors and corresponding confidence intervals. I understand a simple transformation as posted can be simply done by directly addressing the coefficient of interest from the model. However, if we are interested in the ratio of several linear and nonlinear combinations, what would be an efficient method to produce confidence bounds on a transformation such as this? Moreover, when coefficients have a full co-variance matrix with standard errors estimated along with them.

like image 352
bpar Avatar asked Jan 01 '23 21:01

bpar


2 Answers

To answer my own question, I discovered the library(msm) package that accommodates my request nicely with the function deltamethod(). UCLA has a really nice write up of this method, so I am providing the link for anyone who might have a similar need.

Using the delta method for nonlinear transformations of regression coefficients.

like image 135
bpar Avatar answered Jan 03 '23 09:01

bpar


The deltaMethod() function from package car also accomplishes the same, providing as its output the estimate, its standard error and 95% confidence interval.

like image 32
android16.5 Avatar answered Jan 03 '23 11:01

android16.5