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: Graphing with -twoway function-


From   David Torres <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Graphing with -twoway function-
Date   Sat, 28 Dec 2013 12:34:14 -0500

Hello, Statalisters,

I need a bit of help graphing using the -twoway function- command.

Because I used an instrumental variables estimation command (-xtivreg-), I was unable to use the -margins- (then -marginsplot-) command to return predicted trajectories for groups of interest.  I'm able to get close to what I need using the -twoway function- command.

Question:

When using the -twoway function-, how do I set coefficients that are not in the command line at their means?

Here's my command:

twoway function y = _b[_cons] +_b[year]*x + _b[c.year#c.year]*x^2 + ///
   _b[diffsch]*x, range(0 4) legend(label(1 White)) ||function y = _b[_cons] +_b[year]*x + _b[c.year#c.year]*x^2 + _b[2.race] ///
   + _b[2.race#c.year]*x + _b[2.race#c.year#c.year]*x^2 + _b[diffsch]*x + _b[d2]*x, range(0 4) legend(label(2 Black)) || function y = ///
   _b[_cons] +_b[year]*x + _b[c.year#c.year]*x^2 + _b[3.race] + _b[3.race#c.year]*x + _b[3.race#c.year#c.year]*x^2 + _b[diffsch]*x ///
   + _b[d3]*x, range(0 4) legend(label(3 Hispanic)) || function y = _b[_cons] + _b[year]*x + _b[c.year#c.year]*x^2 + _b[4.race] + ///
   _b[4.race#c.year]*x + _b[4.race#c.year#c.year]*x^2 + _b[diffsch]*x + _b[d4]*x, range(0 4) ytitle("SAT Math Score") ///
   xtitle("Grade") legend(label(4 Other Race))

Is there an option to set the other coefficients at their means?

Thanks in advance for any help,
Diego


--

David Diego Torres, PhD
NSF SBE Postdoctoral Research Fellow
Houston Education Research Consortium
Rice University
6100 Main Street, MS-28
Houston, TX  77005
Phone: 713-348-2984
Email: ddtorres at rice dot edu 		 	   		  
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index