Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Marginal effects in mvrs


From   Ryan Edwards <REdwards@gc.cuny.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Marginal effects in mvrs
Date   Mon, 2 Nov 2009 13:17:22 -0500


Hi everyone,

I need to run a model with nonlinear effects of covariates. Based on a post by Nick Cox a year back or so, I tried "mvrs," which I'm asking about. But I'm open to other suggestions; we need to reproduce something that other authors used R's mgcv to estimate, and I'd rather spend time on Stata rather than learning the nuts and bolts of R.

The issues that arise with mvrs have to do with understanding and interpreting the marginal effects of the covariates that enter nonlinearly. I don't understand:

1. What the coefficients on the nonlinearly affecting covariates in the regression output actually mean, and by extension:

2. How I can get marginal effects (and standard errors) of those covariates

Let's suppose the abbreviated output below. What I'd like to do is find the marginal effect on yvar of x2, which enters nonlinearly. One laborious method I can think of is to run the model, then run "predict" on a new sample I create that has only x2 varying, all other covariates fixed at their averages. For obvious reasons, that doesn't appeal; I also don't know how I'd get standard errors that way.

I've tried "mfx" after mvrs, but that returns exactly the same output. I see that fracpred and fracplot are available after mvrs, but I don't think either one produces marginal effects; fracplot seems to be the predicted yvarhat against a covariate, or in other words a total derivative.

Anybody with experience using mvrs out there? Or are there other ado functions that people like better? Thanks for reading.


. mvrs reg yvar x1 x3 x3

Final multivariable spline model for yvar
----------------------------------------------------------------------------
    Variable |    -----Initial-----          -----Final-----
| df Select Alpha Status df Knot positions ------------- +--------------------------------------------------------------
     x1      |    4     1.0000   0.0500     in      1     Linear
     x2      |    4     1.0000   0.0500     in      3     [lin] 23 32
     x3      |    1     1.0000   0.0500     in      2     Linear
----------------------------------------------------------------------------

-------------------------------------------------
        |               Robust
   yvar |      Coef.   Std. Err.      t    P>|t|
-------------+-----------------------------------
     x1    |  -.0094532   .0077835    -1.21   0.225
   x2_0 |  -.2770386   .0442199    -6.27   0.000
   x2_1 |  -.2072394   .0267482    -7.75   0.000
   x2_2 |   .0592096   .0259477     2.28   0.023
     x3    |   .2681678   .0524113     5.12   0.000


Ryan Edwards
Assistant Professor of Economics
Queens College and the Graduate Center
City University of New York
redwards@qc.cuny.edu
cell: 510-484-3912
tel: 212-817-8273
http://qcpages.qc.cuny.edu/~redwards/


Ryan Edwards
Assistant Professor of Economics
Queens College and the Graduate Center
City University of New York
redwards@qc.cuny.edu
cell: 510-484-3912
tel: 212-817-8273
http://qcpages.qc.cuny.edu/~redwards/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index