Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, is already up and running.

[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 <>
To   "" <>
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,

*   For searches and help try:

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