Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Use of -marginsplot- to plot predicted non linear combination of coefficients


From   Charles Vellutini <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Use of -marginsplot- to plot predicted non linear combination of coefficients
Date   Sun, 12 Feb 2012 08:47:20 -0800

Dear statalisters,

I am running the following regression: 

	regress lnq lnp  

and use the coefficient on lnp to compute the following scalar:

	scalar pxopt = CFT*(_b[lnp]/(1+_b[lnp]))

where CFT is a scalar, not a variable (important).

Next, running

	margins,  expression(CFT*(_b[lnp] /(1+_b[lnp] )))

produces the confidence interval for the scalar pxopt, which is already very convenient:

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       _cons |    15.7541   .2571406    61.27   0.000     15.25011    16.25808
------------------------------------------------------------------------------

What I would like is a plot of pxopt, with confidence intervals, at varying values of CFT, say over [5,20]. I have been trying to -generate- an adhoc CFT variable to play with -margins- options (particulary -over()-) and -marginsplot-, all to no avail. It is possible with these commands for what I want? Other commands (maybe -nlcom-, but I would then need to create the graph manually I guess)?

Thanks in advance,
Charles


*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index